mesutt's picture
Upload app.py
c5ba6e0
raw
history blame
672 Bytes
import gradio as gr
deToEng = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-tr-en")
text_to_image = gr.Interface.load("huggingface/runwayml/stable-diffusion-v1-5")
with gr.Blocks() as demo:
title = "Translate from German to English and English text to image"
de_text = gr.Textbox(placeholder="Almanca cümle")
translate_btn = gr.Button("translate from german to english")
eng_text = gr.Textbox(label="ingilizce")
translate_btn.click(deToEng, de_text, eng_text)
text_to_image_btn = gr.Button("text to image")
out = gr.Image()
text_to_image_btn.click(text_to_image, eng_text, out)
demo.launch(share=True)