eudoxie commited on
Commit
18fdd9e
·
verified ·
1 Parent(s): a472b3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -49,14 +49,10 @@ import gradio as gr
49
 
50
  # Function to handle prompt and query the RAG chain
51
  def handle_prompt(message, history):
52
- try:
53
- # Stream output
54
- out=""
55
- for chunk in rag_chain.stream(message):
56
- out += chunk
57
- yield out
58
- except:
59
- raise gr.Error("Requests rate limit exceeded")
60
 
61
 
62
  if __name__=="__main__":
 
49
 
50
  # Function to handle prompt and query the RAG chain
51
  def handle_prompt(message, history):
52
+ partial_text = ""
53
+ for new_text in rag_chain.stream(message):
54
+ partial_text += new_text
55
+ yield partial_text
 
 
 
 
56
 
57
 
58
  if __name__=="__main__":