NCTCMumbai
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -103,7 +103,8 @@ def bot(history, cross_encoder):
|
|
103 |
top_rerank = 25
|
104 |
top_k_rank = 20
|
105 |
query = history[-1][0] if history else ''
|
106 |
-
|
|
|
107 |
if not query:
|
108 |
gr.Warning("Please submit a non-empty string as a prompt")
|
109 |
raise ValueError("Empty string was submitted")
|
@@ -165,7 +166,10 @@ def bot(history, cross_encoder):
|
|
165 |
new_history[-1] = (query, output)
|
166 |
print('New History',new_history)
|
167 |
print('prompt html',prompt_html)# Update the last tuple with new text
|
168 |
-
|
|
|
|
|
|
|
169 |
# new_history,prompt_html
|
170 |
# history[-1][1] = ""
|
171 |
# for character in generate_fn(prompt, history[:-1]):
|
|
|
103 |
top_rerank = 25
|
104 |
top_k_rank = 20
|
105 |
query = history[-1][0] if history else ''
|
106 |
+
print('\nQuery: ',query )
|
107 |
+
print('\nHistory:',history)
|
108 |
if not query:
|
109 |
gr.Warning("Please submit a non-empty string as a prompt")
|
110 |
raise ValueError("Empty string was submitted")
|
|
|
166 |
new_history[-1] = (query, output)
|
167 |
print('New History',new_history)
|
168 |
print('prompt html',prompt_html)# Update the last tuple with new text
|
169 |
+
for character in generate_fn(prompt, history[:-1]):
|
170 |
+
history[-1][1] = character
|
171 |
+
# yield new_history, prompt_html
|
172 |
+
yield history, prompt_html
|
173 |
# new_history,prompt_html
|
174 |
# history[-1][1] = ""
|
175 |
# for character in generate_fn(prompt, history[:-1]):
|