Project_test / app.py
ShamilF's picture
Create app.py
f95af6e
raw
history blame
No virus
506 Bytes
import streamlit as st
from transformers import pipeline
#!pip install sentencepiece
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-tr")
def main():
st.title("English to Turkish Translator")
# Use st.text_area with width parameter
input_text = st.text_area("Enter text in English:", height=100, width=500)
if input_text:
translation = pipe(input_text)[0]["translation_text"]
st.write("Translation:")
st.write(translation)
if __name__ == "__main__":
main()