Skip to content

Commit

Permalink
Update QWEN's RAG template (#2171)
Browse files Browse the repository at this point in the history
it will help to remove `:` at beginning of the answer
  • Loading branch information
openvino-dev-samples authored Jul 5, 2024
1 parent f2ae2e7 commit e872231
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions utils/llm_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ def internlm_partial_text_processor(partial_text, new_text):
<|im_start|>user
Question: {input}
Context: {context}
Answer: <|im_end|><|im_start|>assistant""",
Answer: <|im_end|>
<|im_start|>assistant
""",
},
"gemma-7b-it": {
"model_id": "google/gemma-7b-it",
Expand Down Expand Up @@ -267,7 +269,9 @@ def internlm_partial_text_processor(partial_text, new_text):
<|im_start|>user
问题: {input}
已知内容: {context}
回答: <|im_end|><|im_start|>assistant""",
回答: <|im_end|>
<|im_start|>assistant
""",
},
"qwen1.5-7b-chat": {
"model_id": "Qwen/Qwen1.5-7B-Chat",
Expand All @@ -280,7 +284,9 @@ def internlm_partial_text_processor(partial_text, new_text):
<|im_start|>user
问题: {input}
已知内容: {context}
回答: <|im_end|><|im_start|>assistant""",
回答: <|im_end|>
<|im_start|>assistant
""",
},
"qwen-7b-chat": {
"model_id": "Qwen/Qwen-7B-Chat",
Expand All @@ -296,7 +302,9 @@ def internlm_partial_text_processor(partial_text, new_text):
<|im_start|>user
问题: {input}
已知内容: {context}
回答: <|im_end|><|im_start|>assistant""",
回答: <|im_end|>
<|im_start|>assistant
""",
},
"chatglm3-6b": {
"model_id": "THUDM/chatglm3-6b",
Expand Down Expand Up @@ -361,7 +369,9 @@ def internlm_partial_text_processor(partial_text, new_text):
<|im_start|>user
问题: {input}
已知内容: {context}
回答: <|im_end|><|im_start|>assistant""",
回答: <|im_end|>
<|im_start|>assistant
""",
},
},
"Japanese": {
Expand Down

0 comments on commit e872231

Please sign in to comment.