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