Spaces:
Configuration error
Configuration error
translation2
Browse files
app.py
CHANGED
|
@@ -3,6 +3,8 @@ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, TranslationPipeli
|
|
| 3 |
|
| 4 |
print("Loading the model...")
|
| 5 |
|
|
|
|
|
|
|
| 6 |
# Title and Description
|
| 7 |
st.title("Translation Web App")
|
| 8 |
st.write("""
|
|
@@ -15,8 +17,14 @@ Enter text in the source language, select source and target languages, and see t
|
|
| 15 |
@st.cache_resource
|
| 16 |
def load_translation_pipeline():
|
| 17 |
print("Loading translation model...")
|
| 18 |
-
model = AutoModelForSeq2SeqLM.from_pretrained(
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
return TranslationPipeline(model=model, tokenizer=tokenizer, max_length=1000)
|
| 21 |
|
| 22 |
tilmash = load_translation_pipeline()
|
|
|
|
| 3 |
|
| 4 |
print("Loading the model...")
|
| 5 |
|
| 6 |
+
hf_token = "REMOVED"
|
| 7 |
+
|
| 8 |
# Title and Description
|
| 9 |
st.title("Translation Web App")
|
| 10 |
st.write("""
|
|
|
|
| 17 |
@st.cache_resource
|
| 18 |
def load_translation_pipeline():
|
| 19 |
print("Loading translation model...")
|
| 20 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(
|
| 21 |
+
'issai/tilmash',
|
| 22 |
+
use_auth_token=hf_token
|
| 23 |
+
)
|
| 24 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
| 25 |
+
"issai/tilmash",
|
| 26 |
+
use_auth_token=hf_token
|
| 27 |
+
)
|
| 28 |
return TranslationPipeline(model=model, tokenizer=tokenizer, max_length=1000)
|
| 29 |
|
| 30 |
tilmash = load_translation_pipeline()
|