Spaces:
Sleeping
Sleeping
Commit
·
36c21dd
1
Parent(s):
1f13050
Update main.py
Browse files
main.py
CHANGED
|
@@ -37,11 +37,11 @@ def generate(prompt, history, temperature=0.2, max_new_tokens=30000, top_p=0.95,
|
|
| 37 |
seed=42,
|
| 38 |
)
|
| 39 |
formatted_prompt = format_prompt(prompt, history)
|
| 40 |
-
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=
|
| 41 |
|
| 42 |
-
# Accumula l'output in una
|
| 43 |
-
|
| 44 |
for response in stream:
|
| 45 |
-
|
| 46 |
|
| 47 |
-
return
|
|
|
|
| 37 |
seed=42,
|
| 38 |
)
|
| 39 |
formatted_prompt = format_prompt(prompt, history)
|
| 40 |
+
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
| 41 |
|
| 42 |
+
# Accumula l'output in una lista
|
| 43 |
+
output_list = []
|
| 44 |
for response in stream:
|
| 45 |
+
output_list.append(response.token.text)
|
| 46 |
|
| 47 |
+
return iter(output_list) # Restituisci la lista come un iteratore
|