TestApp / app.py
AlexVed's picture
Update app.py
f6f0134 verified
raw
history blame
418 Bytes
import streamlit as st
from transformers import pipeline
# Load translation model
translator = pipeline('translation_en_to_uk', model='Helsinki-NLP/opus-mt-en-uk')
# Streamlit UI
st.title("English to Ukrainian Translator")
text = st.text_area("Enter English text:")
if text:
translated_text = translator(text, max_length=100)[0]['translation_text']
st.subheader("Translation:")
st.write(translated_text)