Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -290,20 +290,19 @@ def summarize(inp,history,data=None):
|
|
| 290 |
new_data = out[s:e]
|
| 291 |
#yield "", [(inp,f'{mes}\n{new_history}')]
|
| 292 |
|
| 293 |
-
content = NEWS_REPORTER.format(new_data=str(new_data)
|
| 294 |
stream = client.text_generation(content, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
| 295 |
for response in stream:
|
| 296 |
resp += str(response.token.text)
|
| 297 |
-
print(resp)
|
| 298 |
yield "", [(inp,resp)],out_box
|
| 299 |
|
| 300 |
#for line in resp.split("\n"):
|
| 301 |
#if 'title:' in line.lower():
|
| 302 |
|
| 303 |
|
| 304 |
-
#out_json=""
|
| 305 |
out_json=resp.replace("\n","").replace("```","")
|
| 306 |
-
|
| 307 |
out_box.append(out_json.strip("</s>"))
|
| 308 |
#out_box=out_box)
|
| 309 |
print("ADDING")
|
|
|
|
| 290 |
new_data = out[s:e]
|
| 291 |
#yield "", [(inp,f'{mes}\n{new_history}')]
|
| 292 |
|
| 293 |
+
content = NEWS_REPORTER.format(new_data=str(new_data))
|
| 294 |
stream = client.text_generation(content, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
| 295 |
for response in stream:
|
| 296 |
resp += str(response.token.text)
|
| 297 |
+
#print(resp)
|
| 298 |
yield "", [(inp,resp)],out_box
|
| 299 |
|
| 300 |
#for line in resp.split("\n"):
|
| 301 |
#if 'title:' in line.lower():
|
| 302 |
|
| 303 |
|
|
|
|
| 304 |
out_json=resp.replace("\n","").replace("```","")
|
| 305 |
+
print(out_json)
|
| 306 |
out_box.append(out_json.strip("</s>"))
|
| 307 |
#out_box=out_box)
|
| 308 |
print("ADDING")
|