first submit
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ def load_model():
|
|
12 |
tokenizer = T5TokenizerFast.from_pretrained(model_name)
|
13 |
return (model, tokenizer)
|
14 |
|
15 |
-
def
|
16 |
encoded_txt = tokenizer(text, return_tensors="pt")
|
17 |
generated_tokens = model.generate(
|
18 |
**encoded_txt
|
@@ -34,6 +34,6 @@ st.text("Fixed text: ")
|
|
34 |
|
35 |
if text:
|
36 |
model, tokenizer = load_model()
|
37 |
-
translated_text =
|
38 |
st.write(translated_text[0] if translated_text else "Unknown Error Translating Text")
|
39 |
|
|
|
12 |
tokenizer = T5TokenizerFast.from_pretrained(model_name)
|
13 |
return (model, tokenizer)
|
14 |
|
15 |
+
def deuncase(model, tokenizer, text):
|
16 |
encoded_txt = tokenizer(text, return_tensors="pt")
|
17 |
generated_tokens = model.generate(
|
18 |
**encoded_txt
|
|
|
34 |
|
35 |
if text:
|
36 |
model, tokenizer = load_model()
|
37 |
+
translated_text = deuncase(model, tokenizer, text)
|
38 |
st.write(translated_text[0] if translated_text else "Unknown Error Translating Text")
|
39 |
|