Update app.py
Browse files
app.py
CHANGED
@@ -45,11 +45,11 @@ proc1=gr.Interface.load(f"models/{model_1}",live=False,preprocess=True, postproc
|
|
45 |
|
46 |
#pipe = pipeline("translation", model="t5-base")
|
47 |
|
48 |
-
def
|
49 |
|
50 |
return text[::-1]
|
51 |
-
def
|
52 |
-
print("
|
53 |
#img1.update(proc1("girl"))
|
54 |
#german.update("soijfoijf")
|
55 |
img0=proc1("girl")
|
@@ -60,19 +60,20 @@ with gr.Blocks() as demo:
|
|
60 |
with gr.Row():
|
61 |
with gr.Column():
|
62 |
english = gr.Textbox(label="English text")
|
63 |
-
|
64 |
-
translate_btn2 = gr.Button(value="btn2")
|
65 |
with gr.Column():
|
66 |
german = gr.Textbox(label="German Text")
|
67 |
with gr.Row():
|
68 |
img1=gr.Image()
|
69 |
img2=gr.Image()
|
70 |
img3=gr.Image()
|
|
|
|
|
71 |
|
72 |
-
|
73 |
-
|
74 |
examples = gr.Examples(examples=["I went to the supermarket yesterday.", "Helen is a good swimmer."],
|
75 |
inputs=[english])
|
76 |
|
77 |
-
print("
|
78 |
demo.launch()
|
|
|
45 |
|
46 |
#pipe = pipeline("translation", model="t5-base")
|
47 |
|
48 |
+
def bbb22(text):
|
49 |
|
50 |
return text[::-1]
|
51 |
+
def iimg(text):
|
52 |
+
print("\n\nvvv"+text+"\n\n")
|
53 |
#img1.update(proc1("girl"))
|
54 |
#german.update("soijfoijf")
|
55 |
img0=proc1("girl")
|
|
|
60 |
with gr.Row():
|
61 |
with gr.Column():
|
62 |
english = gr.Textbox(label="English text")
|
63 |
+
btn01 = gr.Button(value="btn01")
|
|
|
64 |
with gr.Column():
|
65 |
german = gr.Textbox(label="German Text")
|
66 |
with gr.Row():
|
67 |
img1=gr.Image()
|
68 |
img2=gr.Image()
|
69 |
img3=gr.Image()
|
70 |
+
with gr.Row():
|
71 |
+
btn2 = gr.Button(value="btn2")
|
72 |
|
73 |
+
btn2.click(bbb22,inputs=english,outputs=german)
|
74 |
+
btn01.click(iimg, inputs=english, outputs=img1)
|
75 |
examples = gr.Examples(examples=["I went to the supermarket yesterday.", "Helen is a good swimmer."],
|
76 |
inputs=[english])
|
77 |
|
78 |
+
print("\nabc01aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n")
|
79 |
demo.launch()
|