Kr08 commited on
Commit
3777ba5
·
verified ·
1 Parent(s): 3937497

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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 results if 'translated' in d)}\n\nQuestion: {question}"}
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']