Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
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__":
|