uaritm commited on
Commit
db62d8f
·
1 Parent(s): 8d072b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -23
app.py CHANGED
@@ -1,24 +1,9 @@
1
  import gradio as gr
2
-
3
- from transformers import pipeline
4
-
5
- pipe = pipeline("translation", model="t5-base")
6
-
7
-
8
- def translate(text):
9
- return pipe(text)[0]["translation_text"]
10
-
11
-
12
- with gr.Blocks() as demo:
13
- with gr.Row():
14
- with gr.Column():
15
- english = gr.Textbox(label="English text")
16
- translate_btn = gr.Button(value="Translate")
17
- with gr.Column():
18
- german = gr.Textbox(label="German Text")
19
-
20
- translate_btn.click(translate, inputs=english, outputs=german, api_name="translate-to-german")
21
- examples = gr.Examples(examples=["I went to the supermarket yesterday.", "Helen is a good swimmer."],
22
- inputs=[english])
23
-
24
- demo.launch()
 
1
  import gradio as gr
2
+ description = "BigGAN text-to-image demo."
3
+ title = "BigGAN ImageNet"
4
+ interface = gr.Interface.load("huggingface/osanseviero/BigGAN-deep-128",
5
+ description=description,
6
+ title = title,
7
+ examples=[["american robin"]]
8
+ )
9
+ interface.launch()