johvir commited on
Commit
c64b0da
·
1 Parent(s): 96c098d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -17
app.py CHANGED
@@ -5,23 +5,7 @@ sentence = st.text_area("enter some text")
5
 
6
  if sentence:
7
 
8
- model = T5ForConditionalGeneration.from_pretrained("t5-small")
9
- tokenizer = T5Tokenizer.from_pretrained('t5-small')
10
-
11
- tokenized_sentence = tokenizer('gec: ' + sentence, max_length=128, truncation=True, padding='max_length', return_tensors='pt')
12
- corrected_sentence = tokenizer.decode(
13
- model.generate(
14
- input_ids = tokenized_sentence.input_ids,
15
- attention_mask = tokenized_sentence.attention_mask,
16
- max_length=128,
17
- num_beams=5,
18
- early_stopping=True,
19
- )[0],
20
- skip_special_tokens=True,
21
- clean_up_tokenization_spaces=True
22
- )
23
- #print(corrected_sentence) # -> I like swimming.
24
-
25
  st.json(corrected_sentence)
26
 
27
 
 
5
 
6
  if sentence:
7
 
8
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  st.json(corrected_sentence)
10
 
11