import gradio as gr from transformers import pipeline # Load Tagalog to English model translator = pipeline("translation", model="Helsinki-NLP/opus-mt-tl-en") # Translation function def translate_tl_en(text): result = translator(text)[0]['translation_text'] return result # App layout with gr.Blocks(css="body { background-color: white; }") as app: # Running marquee with black text gr.HTML(""" 🔤 Tagalog to English Translator | Created by Niko Jay Sedan with help from AI | Powered by Hugging Face | Fast, Free & Online! """) # Header and description gr.Markdown("## 🌐 Tagalog to English AI Translator") gr.Markdown("This free online tool translates Tagalog text to English using artificial intelligence. Built by **Niko Jay Sedan** with the help of **Hugging Face AI models**. No API key required.") # Input/Output fields textbox_input = gr.Textbox(lines=2, label="📝 Tagalog Text") textbox_output = gr.Textbox(label="✅ English Translation") # Button translate_btn = gr.Button("Translate Now") translate_btn.click(translate_tl_en, inputs=textbox_input, outputs=textbox_output) # Launch the app app.launch()