Update app.py
Browse files
app.py
CHANGED
|
@@ -112,12 +112,14 @@ with gr.Blocks() as demo:
|
|
| 112 |
"max_new_tokens": max_new_tokens,
|
| 113 |
"temperature": temperature,
|
| 114 |
}
|
| 115 |
-
inference = pipe(sequences=message, streaming=
|
| 116 |
history[-1][1] += message
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
|
|
|
| 120 |
print(pipe.timer_manager)
|
|
|
|
| 121 |
|
| 122 |
textbox.submit(
|
| 123 |
fn=clear_and_save_textbox,
|
|
|
|
| 112 |
"max_new_tokens": max_new_tokens,
|
| 113 |
"temperature": temperature,
|
| 114 |
}
|
| 115 |
+
inference = pipe(sequences=message, streaming=False, **generation_config)
|
| 116 |
history[-1][1] += message
|
| 117 |
+
history[-1][1] += inference.generations[0].text
|
| 118 |
+
# for token in inference:
|
| 119 |
+
# history[-1][1] += token.generations[0].text
|
| 120 |
+
# yield history
|
| 121 |
print(pipe.timer_manager)
|
| 122 |
+
return history
|
| 123 |
|
| 124 |
textbox.submit(
|
| 125 |
fn=clear_and_save_textbox,
|