ALVHB95 commited on
Commit
3c20d34
·
1 Parent(s): 0cece18
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -104,12 +104,16 @@ qa_chain = ConversationalRetrievalChain.from_llm(
104
  get_chat_history = lambda h : h
105
  )
106
 
 
107
 
108
- def chat_interface(question, chat_history):
109
- # ConversationalRetrievalChain
110
- result = qa_chain.run({"question": question, "chat_history": chat_history})
111
- print("Debug: Result from qa_chain.run:", result) # Add this line for debugging
112
- return result
 
 
 
113
 
114
  chatbot_gradio_app = gr.Interface(
115
  fn=chat_interface,
 
104
  get_chat_history = lambda h : h
105
  )
106
 
107
+ def chat_interface(question):
108
 
109
+ result = qa_chain.run({"question": question})
110
+ print("Debug: Result from qa_chain.run:", result)
111
+
112
+ # Check the structure of the result
113
+ if isinstance(result, str):
114
+ return result # If the result is a string, return it directly
115
+ else:
116
+ return "Unexpected result format"
117
 
118
  chatbot_gradio_app = gr.Interface(
119
  fn=chat_interface,