MiVaCod commited on
Commit
601d3fe
·
verified ·
1 Parent(s): 3b2e3f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -8,7 +8,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
8
  model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
9
 
10
  # Function to correct sentences
11
- def correct_sentence(sentence):
12
  inputs = tokenizer.encode("correction: " + sentence, return_tensors="pt", max_length=512, truncation=True)
13
  outputs = model.generate(inputs, max_length=128, num_beams=4, early_stopping=True)
14
  corrected_sentence = tokenizer.decode(outputs[0], skip_special_tokens=True)
 
8
  model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
9
 
10
  # Function to correct sentences
11
+ def predict(sentence):
12
  inputs = tokenizer.encode("correction: " + sentence, return_tensors="pt", max_length=512, truncation=True)
13
  outputs = model.generate(inputs, max_length=128, num_beams=4, early_stopping=True)
14
  corrected_sentence = tokenizer.decode(outputs[0], skip_special_tokens=True)