Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -109,7 +109,7 @@ def answer_question(context, question):
|
|
109 |
return "Please enter your Question"
|
110 |
messages = [
|
111 |
{"role": "system", "content": "You are a helpful assistant who can answer questions based on the given context."},
|
112 |
-
{"role": "user", "content": f"Context: {'\n'.join(d['translated'] for d in
|
113 |
]
|
114 |
|
115 |
response = qa_pipeline(messages, max_new_tokens=256)[0]['generated_text']
|
|
|
109 |
return "Please enter your Question"
|
110 |
messages = [
|
111 |
{"role": "system", "content": "You are a helpful assistant who can answer questions based on the given context."},
|
112 |
+
{"role": "user", "content": f"Context: {'\n'.join(d['translated'] for d in context if 'translated' in d)}\n\nQuestion: {question}"}
|
113 |
]
|
114 |
|
115 |
response = qa_pipeline(messages, max_new_tokens=256)[0]['generated_text']
|