import os import gradio as gr import translators as ts def blog_gen(phrase): ts.google ts._google.language_map eng_other = ts.google(phrase, from_language='en', to_language='de') other_eng = ts.google(eng_other, from_language='de', to_language='en') return other_eng iface = gr.Interface(fn=blog_gen, inputs=[ gr.inputs.Textbox( lines=2, placeholder=None, label='Sentence'), ], outputs=[gr.outputs.JSON(label=None)]) iface.launch()