Muhammad Saqib commited on
Commit
abf72db
1 Parent(s): df18fd9

Delete modules/inference.py

Browse files
Files changed (1) hide show
  1. modules/inference.py +0 -11
modules/inference.py DELETED
@@ -1,11 +0,0 @@
1
- from transformers import T5Tokenizer, T5ForConditionalGeneration
2
-
3
- tokenizer = T5Tokenizer.from_pretrained("t5-small")
4
- model = T5ForConditionalGeneration.from_pretrained("t5-small")
5
-
6
-
7
- def infer_t5(input):
8
- input_ids = tokenizer(input, return_tensors="pt").input_ids
9
- outputs = model.generate(input_ids)
10
-
11
- return tokenizer.decode(outputs[0], skip_special_tokens=True)