Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -160,7 +160,7 @@ def answer_question(context, question):
|
|
160 |
]
|
161 |
response = qa_pipeline(messages, max_new_tokens=256)[0]['generated_text']
|
162 |
logger.info(response)
|
163 |
-
return response[1]
|
164 |
except Exception as e:
|
165 |
logger.error(f"Q&A failed: {str(e)}")
|
166 |
return f"Error occurred during Q&A process: {str(e)}"
|
|
|
160 |
]
|
161 |
response = qa_pipeline(messages, max_new_tokens=256)[0]['generated_text']
|
162 |
logger.info(response)
|
163 |
+
return response[-1]['content']
|
164 |
except Exception as e:
|
165 |
logger.error(f"Q&A failed: {str(e)}")
|
166 |
return f"Error occurred during Q&A process: {str(e)}"
|