Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,8 @@
|
|
| 1 |
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 2 |
import gradio as grad
|
| 3 |
-
|
| 4 |
text2text_tkn= T5Tokenizer.from_pretrained("t5-small")
|
| 5 |
mdl = T5ForConditionalGeneration.from_pretrained("t5-small")
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
def text2text_translation(text):
|
| 10 |
inp = "translate English to German:: "+text
|
| 11 |
enc = text2text_tkn(inp, return_tensors="pt")
|
|
|
|
| 1 |
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 2 |
import gradio as grad
|
|
|
|
| 3 |
text2text_tkn= T5Tokenizer.from_pretrained("t5-small")
|
| 4 |
mdl = T5ForConditionalGeneration.from_pretrained("t5-small")
|
| 5 |
|
|
|
|
|
|
|
| 6 |
def text2text_translation(text):
|
| 7 |
inp = "translate English to German:: "+text
|
| 8 |
enc = text2text_tkn(inp, return_tensors="pt")
|