Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,7 +71,10 @@ def generate(prompt, history,max_new_tokens,temperature=temperature,top_p=top_p,
|
|
| 71 |
|
| 72 |
for response in stream:
|
| 73 |
output += response.token.text
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
lines = output.strip().strip("\n").split("\n")
|
| 77 |
#history=""
|
|
@@ -86,8 +89,11 @@ def generate(prompt, history,max_new_tokens,temperature=temperature,top_p=top_p,
|
|
| 86 |
print(line)
|
| 87 |
if line.startswith("5. "):
|
| 88 |
print(line)
|
| 89 |
-
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
def clear_fn():
|
| 93 |
return None,None
|
|
|
|
| 71 |
|
| 72 |
for response in stream:
|
| 73 |
output += response.token.text
|
| 74 |
+
if history:
|
| 75 |
+
yield "",[history,[(prompt,output)]]
|
| 76 |
+
else:
|
| 77 |
+
yield "",[(prompt,output)]
|
| 78 |
|
| 79 |
lines = output.strip().strip("\n").split("\n")
|
| 80 |
#history=""
|
|
|
|
| 89 |
print(line)
|
| 90 |
if line.startswith("5. "):
|
| 91 |
print(line)
|
| 92 |
+
|
| 93 |
+
if history:
|
| 94 |
+
return "",[history,[(prompt,output)]]
|
| 95 |
+
else:
|
| 96 |
+
return "",[(prompt,output)]
|
| 97 |
|
| 98 |
def clear_fn():
|
| 99 |
return None,None
|