Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -72,7 +72,13 @@ def chat_inf(system_prompt,prompt,history,memory,client_choice,seed,temp,tokens,
|
|
| 72 |
formatted_prompt = format_prompt(f"{system_prompt}, {prompt}", memory[0-chat_mem:],cust_p)
|
| 73 |
else:
|
| 74 |
formatted_prompt = format_prompt(prompt, memory[0-chat_mem:],cust_p)
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
output = ""
|
| 77 |
for response in stream:
|
| 78 |
output += response.token.text
|
|
|
|
| 72 |
formatted_prompt = format_prompt(f"{system_prompt}, {prompt}", memory[0-chat_mem:],cust_p)
|
| 73 |
else:
|
| 74 |
formatted_prompt = format_prompt(prompt, memory[0-chat_mem:],cust_p)
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
chat = [
|
| 78 |
+
{ "role": "user", "content": f"{formatted_prompt}" },
|
| 79 |
+
]
|
| 80 |
+
|
| 81 |
+
stream = client.text_generation(chat **generate_kwargs, stream=True, details=True, return_full_text=True)
|
| 82 |
output = ""
|
| 83 |
for response in stream:
|
| 84 |
output += response.token.text
|