Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,10 +3,11 @@ from transformers import pipeline
|
|
3 |
|
4 |
pipeline = pipeline(task="translation", model="guymorlan/Shami2English")
|
5 |
|
6 |
-
st.title("
|
7 |
|
8 |
text = st.text_input("Enter text to translate:")
|
|
|
9 |
|
10 |
if text:
|
11 |
-
result =
|
12 |
-
st.
|
|
|
3 |
|
4 |
pipeline = pipeline(task="translation", model="guymorlan/Shami2English")
|
5 |
|
6 |
+
st.title("Levantine Arabic to English")
|
7 |
|
8 |
text = st.text_input("Enter text to translate:")
|
9 |
+
num_translations = st.selectbox("Number of Translations:", [1, 2, 3, 4, 5], index=2)
|
10 |
|
11 |
if text:
|
12 |
+
result = translator(input_text, max_length=1024, num_return_sequences=num_translations, num_beams=num_translations)[0]['generated_text']
|
13 |
+
st.markdown("<div style='font-size:24px; text-align:right; direction:rtl;'>{}</div>".format(result), unsafe_allow_html=True)
|