Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -34,9 +34,13 @@ def chat_inf(system_prompt,prompt,history):
|
|
34 |
formatted_prompt = format_prompt(f"{system_prompt}, {prompt}", history)
|
35 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
36 |
output = ""
|
|
|
37 |
for response in stream:
|
38 |
output += response.token.text
|
39 |
-
|
|
|
|
|
|
|
40 |
yield hist
|
41 |
|
42 |
|
|
|
34 |
formatted_prompt = format_prompt(f"{system_prompt}, {prompt}", history)
|
35 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
36 |
output = ""
|
37 |
+
|
38 |
for response in stream:
|
39 |
output += response.token.text
|
40 |
+
if history:
|
41 |
+
hist=[history,(prompt,output)]
|
42 |
+
else:
|
43 |
+
hist=[(prompt,output)]
|
44 |
yield hist
|
45 |
|
46 |
|