sashdev commited on
Commit
625eebf
·
verified ·
1 Parent(s): c2f522f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -17,7 +17,7 @@ def correct_grammar(text):
17
  inputs = tokenizer([text], return_tensors="pt", padding=True, truncation=True, max_length=1024).to(device)
18
 
19
  # Generate corrected text with increased max_length and num_beams
20
- outputs = model.generate(**inputs, max_length=1024, num_beams=5, early_stopping=True)
21
 
22
  # Decode the output and return the corrected text
23
  corrected_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
 
17
  inputs = tokenizer([text], return_tensors="pt", padding=True, truncation=True, max_length=1024).to(device)
18
 
19
  # Generate corrected text with increased max_length and num_beams
20
+ outputs = model.generate(**inputs, max_length=2024, num_beams=5, early_stopping=True)
21
 
22
  # Decode the output and return the corrected text
23
  corrected_text = tokenizer.decode(outputs[0], skip_special_tokens=True)