Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -36,11 +36,13 @@ if st.button("Generate Text"):
|
|
36 |
with torch.no_grad():
|
37 |
beam_output = model.generate(
|
38 |
**inputs,
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
)
|
|
|
|
|
44 |
|
45 |
# Decode and display the result
|
46 |
generated_text = tokenizer.decode(beam_output[0], skip_special_tokens=True)
|
|
|
36 |
with torch.no_grad():
|
37 |
beam_output = model.generate(
|
38 |
**inputs,
|
39 |
+
max_length=1024,
|
40 |
+
do_sample=True,
|
41 |
+
top_p=0.9,
|
42 |
+
top_k=50
|
43 |
)
|
44 |
+
|
45 |
+
|
46 |
|
47 |
# Decode and display the result
|
48 |
generated_text = tokenizer.decode(beam_output[0], skip_special_tokens=True)
|