Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,21 @@ import gradio as gr
|
|
2 |
|
3 |
def update(name):
|
4 |
return f"Welcome to Gradio, {name}!"
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
demo = gr.Blocks()
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
with demo:
|
9 |
gr.Markdown(
|
10 |
"""
|
@@ -12,10 +24,17 @@ with demo:
|
|
12 |
Start typing below to see the output.
|
13 |
""")
|
14 |
inp = gr.Textbox(placeholder="What is your name?")
|
15 |
-
|
|
|
|
|
16 |
|
17 |
inp.change(fn=update,
|
18 |
inputs=inp,
|
19 |
-
outputs=
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
21 |
demo.launch()
|
|
|
2 |
|
3 |
def update(name):
|
4 |
return f"Welcome to Gradio, {name}!"
|
5 |
+
|
6 |
+
generator1 = gr.Interface.load("huggingface/gpt2-large")
|
7 |
+
generator2 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B")
|
8 |
+
generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")
|
9 |
+
|
10 |
|
11 |
demo = gr.Blocks()
|
12 |
|
13 |
+
def f1(x):
|
14 |
+
return generator1(x)
|
15 |
+
def f2(x):
|
16 |
+
return generator2(x)
|
17 |
+
def f3(x):
|
18 |
+
return generator3(x)
|
19 |
+
|
20 |
with demo:
|
21 |
gr.Markdown(
|
22 |
"""
|
|
|
24 |
Start typing below to see the output.
|
25 |
""")
|
26 |
inp = gr.Textbox(placeholder="What is your name?")
|
27 |
+
out1 = gr.Textbox()
|
28 |
+
out2 = gr.Textbox()
|
29 |
+
out3 = gr.Textbox()
|
30 |
|
31 |
inp.change(fn=update,
|
32 |
inputs=inp,
|
33 |
+
outputs=out1)
|
34 |
+
inp.change(fn=update,
|
35 |
+
inputs=inp,
|
36 |
+
outputs=out2)
|
37 |
+
inp.change(fn=update,
|
38 |
+
inputs=inp,
|
39 |
+
outputs=out3)
|
40 |
demo.launch()
|