Sadiaa commited on
Commit
5a91f55
·
verified ·
1 Parent(s): 62cdadc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -87,14 +87,18 @@ def delete_chat(chat_id: str):
87
  def response(request: ChatRequest):
88
  chat_id = request.chat_id
89
  question = request.question
 
90
 
91
  try:
92
  answer = chatbot.response(question, chat_id)
 
93
  return {"answer": answer}
94
 
95
  except KeyError:
 
96
  raise HTTPException(status_code=404, detail="Chat ID not found")
97
 
98
  except Exception as e:
 
99
  raise HTTPException(status_code=500, detail="GPU error, try after some time...")
100
 
 
87
  def response(request: ChatRequest):
88
  chat_id = request.chat_id
89
  question = request.question
90
+ print(f"Received question: {question} with chat_id: {chat_id}") # Debug line
91
 
92
  try:
93
  answer = chatbot.response(question, chat_id)
94
+ print(f"Generated answer: {answer}")
95
  return {"answer": answer}
96
 
97
  except KeyError:
98
+ print("Chat ID not found!")
99
  raise HTTPException(status_code=404, detail="Chat ID not found")
100
 
101
  except Exception as e:
102
+ print(f"Exception: {e}")
103
  raise HTTPException(status_code=500, detail="GPU error, try after some time...")
104