deep-learning-analytics commited on
Commit
b371d73
·
1 Parent(s): d10a88b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,9 +10,9 @@ model = T5ForConditionalGeneration.from_pretrained('deep-learning-analytics/Gram
10
  def correct_grammar(input_text,num_return_sequences=1):
11
  batch = tokenizer([input_text],truncation=True,padding='max_length',max_length=64, return_tensors="pt").to(torch_device)
12
  translated = model.generate(**batch,max_length=64,num_beams=2, num_return_sequences=num_return_sequences, temperature=1.5)
13
- tgt_text = tokenizer.batch_decode(translated, skip_special_tokens=True)[0]
14
  return tgt_text
15
 
16
  if text:
17
- result = correct_grammar(text)
18
  st.json(result)
 
10
  def correct_grammar(input_text,num_return_sequences=1):
11
  batch = tokenizer([input_text],truncation=True,padding='max_length',max_length=64, return_tensors="pt").to(torch_device)
12
  translated = model.generate(**batch,max_length=64,num_beams=2, num_return_sequences=num_return_sequences, temperature=1.5)
13
+ tgt_text = tokenizer.batch_decode(translated, skip_special_tokens=True)
14
  return tgt_text
15
 
16
  if text:
17
+ result = correct_grammar(text)[0]
18
  st.json(result)