Spaces:
Runtime error
Runtime error
KonradSzafer
commited on
Commit
•
e64c2ac
1
Parent(s):
b7068fd
zephyr update
Browse files
config/prompt_templates/zephyr_7b.txt
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<|system|>Using the information contained in the context,
|
2 |
+
give a comprehensive answer to the question.
|
3 |
+
Respond only to the question asked, response should be concise and relevant to the question.
|
4 |
+
If the answer cannot be deduced from the context, do not give an answer.</s>
|
5 |
+
<|user|>
|
6 |
+
Context:
|
7 |
+
{context}
|
8 |
+
Question: {question}
|
9 |
+
</s>
|
10 |
+
<|assistant|>
|
qa_engine/qa_engine.py
CHANGED
@@ -240,15 +240,15 @@ class QAEngine():
|
|
240 |
'''
|
241 |
Preprocess the answer by removing unnecessary sequences and stop sequences.
|
242 |
'''
|
243 |
-
|
244 |
'Factually: ', 'Answer: ', '<<SYS>>', '<</SYS>>', '[INST]', '[/INST]'
|
245 |
]
|
246 |
-
|
247 |
-
'
|
248 |
]
|
249 |
-
for seq in
|
250 |
answer = answer.replace(seq, '')
|
251 |
-
for seq in
|
252 |
if seq in answer:
|
253 |
answer = answer[:answer.index(seq)]
|
254 |
answer = answer.strip()
|
|
|
240 |
'''
|
241 |
Preprocess the answer by removing unnecessary sequences and stop sequences.
|
242 |
'''
|
243 |
+
SEQUENCES_TO_REMOVE = [
|
244 |
'Factually: ', 'Answer: ', '<<SYS>>', '<</SYS>>', '[INST]', '[/INST]'
|
245 |
]
|
246 |
+
SEQUENCES_TO_STOP = [
|
247 |
+
'User:', 'You:', 'Question:'
|
248 |
]
|
249 |
+
for seq in SEQUENCES_TO_REMOVE:
|
250 |
answer = answer.replace(seq, '')
|
251 |
+
for seq in SEQUENCES_TO_STOP:
|
252 |
if seq in answer:
|
253 |
answer = answer[:answer.index(seq)]
|
254 |
answer = answer.strip()
|