Update app.py
Browse files
app.py
CHANGED
|
@@ -45,7 +45,9 @@ proc1=gr.Interface.load(f"models/{model_1}",live=False,preprocess=True, postproc
|
|
| 45 |
|
| 46 |
#pipe = pipeline("translation", model="t5-base")
|
| 47 |
|
|
|
|
| 48 |
|
|
|
|
| 49 |
def translate(text):
|
| 50 |
print("vvv")
|
| 51 |
#img1.update(proc1("girl"))
|
|
@@ -68,7 +70,7 @@ with gr.Blocks() as demo:
|
|
| 68 |
img3=gr.Image()
|
| 69 |
|
| 70 |
translate_btn.click(translate, inputs=english, outputs=img1, api_name="translate-to-german")
|
| 71 |
-
translate_btn2.click(
|
| 72 |
examples = gr.Examples(examples=["I went to the supermarket yesterday.", "Helen is a good swimmer."],
|
| 73 |
inputs=[english])
|
| 74 |
|
|
|
|
| 45 |
|
| 46 |
#pipe = pipeline("translation", model="t5-base")
|
| 47 |
|
| 48 |
+
def translate2(text):
|
| 49 |
|
| 50 |
+
return text[::-1]
|
| 51 |
def translate(text):
|
| 52 |
print("vvv")
|
| 53 |
#img1.update(proc1("girl"))
|
|
|
|
| 70 |
img3=gr.Image()
|
| 71 |
|
| 72 |
translate_btn.click(translate, inputs=english, outputs=img1, api_name="translate-to-german")
|
| 73 |
+
translate_btn2.click(translate2,intpus=english,outputs=german)
|
| 74 |
examples = gr.Examples(examples=["I went to the supermarket yesterday.", "Helen is a good swimmer."],
|
| 75 |
inputs=[english])
|
| 76 |
|