Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,9 +23,9 @@ def generate_text(input_text):
|
|
| 23 |
inputs["input_ids"],
|
| 24 |
max_length=256, # Set max length for output
|
| 25 |
num_return_sequences=1,
|
| 26 |
-
temperature=0.
|
| 27 |
top_k=50, # Top-k sampling to limit vocabulary to top 50 choices
|
| 28 |
-
top_p=0.
|
| 29 |
repetition_penalty=1.2, # Penalize repetition; increase if repetitions persist
|
| 30 |
do_sample=True # Enable sampling for non-deterministic output
|
| 31 |
)
|
|
|
|
| 23 |
inputs["input_ids"],
|
| 24 |
max_length=256, # Set max length for output
|
| 25 |
num_return_sequences=1,
|
| 26 |
+
temperature=0.2, # Control randomness (higher is more random)
|
| 27 |
top_k=50, # Top-k sampling to limit vocabulary to top 50 choices
|
| 28 |
+
top_p=0.8, # Nucleus sampling to choose tokens with 95% cumulative probability
|
| 29 |
repetition_penalty=1.2, # Penalize repetition; increase if repetitions persist
|
| 30 |
do_sample=True # Enable sampling for non-deterministic output
|
| 31 |
)
|