Spaces:
Sleeping
Sleeping
| 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.markdown to set the width with HTML | |
| input_text = st.text_area("Enter text in English:", height=100) | |
| if input_text: | |
| translation = pipe(input_text)[0]["translation_text"] | |
| st.write("Translation:") | |
| st.write(translation) | |
| if __name__ == "__main__": | |
| main() | |