Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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'])
|