guymorlan commited on
Commit
44d608a
·
1 Parent(s): 966f815

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -5,9 +5,10 @@ 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)
 
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)