guymorlan commited on
Commit
55bcb27
1 Parent(s): 8c0c714

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ pipeline = pipeline(task="translation", model="guymorlan/Shami2English")
5
+
6
+ st.title("Translate Levantine Arabic to English")
7
+
8
+ text = st.text_input("Enter text to translate:")
9
+
10
+ if text:
11
+ result = model(text, max_length=1024)
12
+ st.write("Translation:", result[0]['translated_text'])