ShamilF commited on
Commit
f95af6e
1 Parent(s): 2457027

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+ #!pip install sentencepiece
4
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-tr")
5
+
6
+ def main():
7
+ st.title("English to Turkish Translator")
8
+
9
+ # Use st.text_area with width parameter
10
+ input_text = st.text_area("Enter text in English:", height=100, width=500)
11
+
12
+ if input_text:
13
+ translation = pipe(input_text)[0]["translation_text"]
14
+ st.write("Translation:")
15
+ st.write(translation)
16
+
17
+ if __name__ == "__main__":
18
+ main()