File size: 665 Bytes
c5ba6e0
f58fee2
c5ba6e0
 
 
f58fee2
c5ba6e0
f58fee2
 
c5ba6e0
 
f58fee2
c5ba6e0
 
 
 
 
 
 
5d04f38
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
trToEng = 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 Turkish to English and English text to image"
    
    de_text = gr.Textbox(placeholder="Türkçe cümle")
    translate_btn = gr.Button("translate from Turkish to english")
    
    eng_text = gr.Textbox(label="ingilizce")
    translate_btn.click(trToEng, 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()