import os import gradio as gr import translators as ts def blog_gen(phrase): ts.google ts._google.language_map eng_de = ts.google(phrase, from_language='en', to_language='de') eng_ar = ts.google(phrase, from_language='en', to_language='ar') eng_fr = ts.google(phrase, from_language='en', to_language='fr') eng_zh = ts.google(phrase, from_language='en', to_language='zh') eng_ur = ts.google(phrase, from_language='en', to_language='ur') eng_sv = ts.google(phrase, from_language='en', to_language='sv') de_eng = ts.google(eng_de, from_language='de', to_language='en') de_ar = ts.google(eng_ar, from_language='ar', to_language='en') de_fr = ts.google(eng_fr, from_language='fr', to_language='en') de_zh = ts.google(eng_zh, from_language='zh', to_language='en') de_ur = ts.google(eng_ur, from_language='ur', to_language='en') de_sv = ts.google(eng_sv, from_language='sv', to_language='en') return de_eng,de_ar,de_fr,de_zh,de_ur,de_sv iface = gr.Interface(fn=blog_gen, inputs=[ gr.inputs.Textbox( lines=2, placeholder=None, label='Sentence'), ], outputs="text") iface.launch()