Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -108,7 +108,7 @@ with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;}
|
|
108 |
#tokens = tokens.to(device)
|
109 |
#eos_token_id = tokenizer.eos_token_id
|
110 |
# use the model to generate new tokens.
|
111 |
-
generated_output = model.generate(**tokens, use_cache=True, max_new_tokens=
|
112 |
|
113 |
# Find the position of "Output:" and extract the text after it
|
114 |
generated_text = tokenizer.batch_decode(generated_output)[0]
|
|
|
108 |
#tokens = tokens.to(device)
|
109 |
#eos_token_id = tokenizer.eos_token_id
|
110 |
# use the model to generate new tokens.
|
111 |
+
generated_output = model.generate(**tokens, use_cache=True, max_new_tokens=100, eos_token_id=50256, pad_token_id=50256)
|
112 |
|
113 |
# Find the position of "Output:" and extract the text after it
|
114 |
generated_text = tokenizer.batch_decode(generated_output)[0]
|