Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,14 +24,15 @@ def generate_text(input_text, history):
|
|
| 24 |
print("new input", input_text_with_history)
|
| 25 |
output = llm(input_text_with_history, max_tokens=1024, stop=["Q:", "\n"], stream=True)
|
| 26 |
for out in output:
|
|
|
|
| 27 |
stream = copy.deepcopy(out)
|
| 28 |
print(stream["choices"][0]["text"])
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
history =["init",
|
| 35 |
|
| 36 |
|
| 37 |
|
|
|
|
| 24 |
print("new input", input_text_with_history)
|
| 25 |
output = llm(input_text_with_history, max_tokens=1024, stop=["Q:", "\n"], stream=True)
|
| 26 |
for out in output:
|
| 27 |
+
history1[-1][1] = ""
|
| 28 |
stream = copy.deepcopy(out)
|
| 29 |
print(stream["choices"][0]["text"])
|
| 30 |
+
history1[-1][1] += stream["choices"][0]["text"]
|
| 31 |
+
time.sleep(0.05)
|
| 32 |
+
yield history1
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
history =["init",input_text_with_history]
|
| 36 |
|
| 37 |
|
| 38 |
|