Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,21 +16,21 @@ def load_model():
|
|
| 16 |
return model,tokenizer
|
| 17 |
|
| 18 |
model,tokenizer=load_model()
|
| 19 |
-
st.title("
|
| 20 |
|
| 21 |
-
st.write("This app demonstrates translation capabilities of LLM")
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
col1,col2 = st.columns(2)
|
| 26 |
|
| 27 |
with col1:
|
| 28 |
-
source_language=st.radio("Select source language",["zh","de"])
|
| 29 |
user_text = st.text_area("Enter text for translation")
|
| 30 |
|
| 31 |
|
| 32 |
with col2:
|
| 33 |
-
target_language=st.radio("Select
|
| 34 |
if user_text:
|
| 35 |
tokenizer.src_lang = source_language#"zh"#"hi"
|
| 36 |
encoded_text = tokenizer(user_text, return_tensors="pt").to(device)
|
|
|
|
| 16 |
return model,tokenizer
|
| 17 |
|
| 18 |
model,tokenizer=load_model()
|
| 19 |
+
st.title("Multilingual translation app")
|
| 20 |
|
| 21 |
+
st.write("This app demonstrates translation capabilities of LLM.The app leverages M2M100_418M model by facebook")
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
col1,col2 = st.columns(2)
|
| 26 |
|
| 27 |
with col1:
|
| 28 |
+
source_language=st.radio("Select source language",["ar","zh","de","bn","Kn","ta"])
|
| 29 |
user_text = st.text_area("Enter text for translation")
|
| 30 |
|
| 31 |
|
| 32 |
with col2:
|
| 33 |
+
target_language=st.radio("Select target language",["en","de","bn","hi","kn","ta"])
|
| 34 |
if user_text:
|
| 35 |
tokenizer.src_lang = source_language#"zh"#"hi"
|
| 36 |
encoded_text = tokenizer(user_text, return_tensors="pt").to(device)
|