Spaces:
Running
Running
set pad_token_id explicitly in suggest_next_word function
Browse files
app.py
CHANGED
@@ -24,6 +24,7 @@ def suggest_next_word(prompt, num_suggestions=3,temper=0.7):
|
|
24 |
do_sample=True,
|
25 |
top_k=50, # Adjust for randomness in suggestions
|
26 |
temperature=temper, # Adjust for creativity in suggestions
|
|
|
27 |
)
|
28 |
# Decode and extract next words
|
29 |
suggestions = []
|
|
|
24 |
do_sample=True,
|
25 |
top_k=50, # Adjust for randomness in suggestions
|
26 |
temperature=temper, # Adjust for creativity in suggestions
|
27 |
+
pad_token_id=tokenizer.eos_token_id, # Set pad_token_id explicitly
|
28 |
)
|
29 |
# Decode and extract next words
|
30 |
suggestions = []
|