ShahzaibDev commited on
Commit
926527f
·
verified ·
1 Parent(s): 8be459e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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
- min_length=100,
40
- max_length=1024,
41
- num_beams=5,
42
- early_stopping=True
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)