Spaces:
Runtime error
Runtime error
Commit
·
1f13050
1
Parent(s):
f21499d
Update main.py
Browse files
main.py
CHANGED
|
@@ -39,9 +39,9 @@ def generate(prompt, history, temperature=0.2, max_new_tokens=30000, top_p=0.95,
|
|
| 39 |
formatted_prompt = format_prompt(prompt, history)
|
| 40 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)
|
| 41 |
|
| 42 |
-
# Accumula l'output in una lista
|
| 43 |
-
|
| 44 |
for response in stream:
|
| 45 |
-
|
| 46 |
|
| 47 |
-
return
|
|
|
|
| 39 |
formatted_prompt = format_prompt(prompt, history)
|
| 40 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=True)
|
| 41 |
|
| 42 |
+
# Accumula l'output in una stringa anziché una lista
|
| 43 |
+
output_text = ""
|
| 44 |
for response in stream:
|
| 45 |
+
output_text += response.token.text
|
| 46 |
|
| 47 |
+
return output_text # Restituisci l'intero testo generato come una stringa
|