Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -20,13 +20,12 @@ def generate_text(input_text, history):
|
|
20 |
input_text_with_history = f"{history[-1][1]}"+ "\n"
|
21 |
input_text_with_history += f"Q: {input_text} \n A:"
|
22 |
print("new input", input_text_with_history)
|
23 |
-
output = llm(input_text_with_history, max_tokens=1024, stop=["Q:", "\n"], stream=True)
|
24 |
|
25 |
for out in output:
|
26 |
stream = copy.deepcopy(out)
|
27 |
print(stream["choices"][0]["text"])
|
28 |
-
yield
|
29 |
-
print("latest token : " ,stream["choices"][0]["text"])
|
30 |
|
31 |
history =["init",input_text_with_history]
|
32 |
|
|
|
20 |
input_text_with_history = f"{history[-1][1]}"+ "\n"
|
21 |
input_text_with_history += f"Q: {input_text} \n A:"
|
22 |
print("new input", input_text_with_history)
|
23 |
+
output = llm(input_text_with_history, max_tokens=1024, stop=["Q:", "\n"], stream=True, echo=true)
|
24 |
|
25 |
for out in output:
|
26 |
stream = copy.deepcopy(out)
|
27 |
print(stream["choices"][0]["text"])
|
28 |
+
yield output
|
|
|
29 |
|
30 |
history =["init",input_text_with_history]
|
31 |
|