Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -359,6 +359,7 @@ def generate(
|
|
| 359 |
formatted_prompt = format_prompt(formatted_prompt, history, max_history_turns=5) # Truncated history
|
| 360 |
logging.info(f"Formatted Prompt: {formatted_prompt}")
|
| 361 |
stream = client.text_generation(formatted_prompt, temperature=temperature, max_new_tokens=max_new_tokens, top_p=top_p, repetition_penalty=repetition_penalty, stream=True, details=True, return_full_text=False)
|
|
|
|
| 362 |
for response in stream:
|
| 363 |
resp += response.token.text
|
| 364 |
|
|
|
|
| 359 |
formatted_prompt = format_prompt(formatted_prompt, history, max_history_turns=5) # Truncated history
|
| 360 |
logging.info(f"Formatted Prompt: {formatted_prompt}")
|
| 361 |
stream = client.text_generation(formatted_prompt, temperature=temperature, max_new_tokens=max_new_tokens, top_p=top_p, repetition_penalty=repetition_penalty, stream=True, details=True, return_full_text=False)
|
| 362 |
+
resp = ""
|
| 363 |
for response in stream:
|
| 364 |
resp += response.token.text
|
| 365 |
|