NCTCMumbai
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -155,10 +155,15 @@ def bot(history, cross_encoder):
|
|
155 |
generate_fn=generate_qwen
|
156 |
# Create a new history entry instead of modifying the tuple directly
|
157 |
new_history = history[:-1] + [ (query, "") ]
|
|
|
158 |
for character in generate_fn(prompt, history[:-1]):
|
159 |
-
new_history[-1] = (query, character)
|
|
|
|
|
|
|
160 |
#print('Character',character)# Update the last tuple with new text
|
161 |
-
yield new_history, prompt_html
|
|
|
162 |
# history[-1][1] = ""
|
163 |
# for character in generate_fn(prompt, history[:-1]):
|
164 |
# history[-1][1] = character
|
|
|
155 |
generate_fn=generate_qwen
|
156 |
# Create a new history entry instead of modifying the tuple directly
|
157 |
new_history = history[:-1] + [ (query, "") ]
|
158 |
+
output=''
|
159 |
for character in generate_fn(prompt, history[:-1]):
|
160 |
+
#new_history[-1] = (query, character)
|
161 |
+
output+=character
|
162 |
+
print('Output:',output)
|
163 |
+
new_history[-1] = (query, output)
|
164 |
#print('Character',character)# Update the last tuple with new text
|
165 |
+
#yield new_history, prompt_html
|
166 |
+
return new_history,prompt_html
|
167 |
# history[-1][1] = ""
|
168 |
# for character in generate_fn(prompt, history[:-1]):
|
169 |
# history[-1][1] = character
|