Kr08 commited on
Commit
1aa0b18
·
verified ·
1 Parent(s): e2dfaeb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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)}"