Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -100,8 +100,7 @@ class StopOnTokens(StoppingCriteria):
|
|
| 100 |
return False
|
| 101 |
|
| 102 |
|
| 103 |
-
def
|
| 104 |
-
|
| 105 |
global source_text
|
| 106 |
global assess_rag
|
| 107 |
#For now, we only query the vector database once, at the start.
|
|
@@ -114,6 +113,10 @@ def predict(message, history):
|
|
| 114 |
|
| 115 |
history_transformer_format = history + [[message, ""]]
|
| 116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
print(history_transformer_format)
|
| 118 |
stop = StopOnTokens()
|
| 119 |
|
|
@@ -177,9 +180,6 @@ with gr.Blocks() as demo:
|
|
| 177 |
msg = gr.Textbox()
|
| 178 |
clear = gr.Button("Clear")
|
| 179 |
|
| 180 |
-
def user(user_message, history):
|
| 181 |
-
return "", history + [[user_message, None]]
|
| 182 |
-
|
| 183 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
| 184 |
predict, chatbot, chatbot
|
| 185 |
)
|
|
|
|
| 100 |
return False
|
| 101 |
|
| 102 |
|
| 103 |
+
def user(message, history):
|
|
|
|
| 104 |
global source_text
|
| 105 |
global assess_rag
|
| 106 |
#For now, we only query the vector database once, at the start.
|
|
|
|
| 113 |
|
| 114 |
history_transformer_format = history + [[message, ""]]
|
| 115 |
|
| 116 |
+
return history_transformer_format
|
| 117 |
+
|
| 118 |
+
def predict(history):
|
| 119 |
+
|
| 120 |
print(history_transformer_format)
|
| 121 |
stop = StopOnTokens()
|
| 122 |
|
|
|
|
| 180 |
msg = gr.Textbox()
|
| 181 |
clear = gr.Button("Clear")
|
| 182 |
|
|
|
|
|
|
|
|
|
|
| 183 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
| 184 |
predict, chatbot, chatbot
|
| 185 |
)
|