File size: 672 Bytes
c5ba6e0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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)
|