Spaces:
Running
Running
Ahsen Khaliq
commited on
Commit
•
908b776
1
Parent(s):
7e8fab9
Update app.py
Browse files
app.py
CHANGED
@@ -14,19 +14,24 @@ io1 = gr.Interface.load("huggingface/t5-base")
|
|
14 |
|
15 |
io2 = gr.Interface.load("huggingface/t5-small")
|
16 |
|
|
|
|
|
|
|
17 |
|
18 |
def inference(text, model):
|
19 |
if model == "t5-base":
|
20 |
outtext = io1(text)
|
21 |
-
|
22 |
outtext = io2(text)
|
|
|
|
|
23 |
return outtext
|
24 |
|
25 |
|
26 |
|
27 |
gr.Interface(
|
28 |
inference,
|
29 |
-
[gr.inputs.Textbox(label="Input"),gr.inputs.Dropdown(choices=["t5-base","t5-small"], type="value", default="t5-base", label="model")
|
30 |
],
|
31 |
gr.outputs.Textbox(label="Output"),
|
32 |
examples=examples,
|
|
|
14 |
|
15 |
io2 = gr.Interface.load("huggingface/t5-small")
|
16 |
|
17 |
+
io3 = gr.Interface.load("huggingface/t5-large")
|
18 |
+
|
19 |
+
|
20 |
|
21 |
def inference(text, model):
|
22 |
if model == "t5-base":
|
23 |
outtext = io1(text)
|
24 |
+
elif model == "t5-small":
|
25 |
outtext = io2(text)
|
26 |
+
else:
|
27 |
+
outtext = io3(text)
|
28 |
return outtext
|
29 |
|
30 |
|
31 |
|
32 |
gr.Interface(
|
33 |
inference,
|
34 |
+
[gr.inputs.Textbox(label="Input"),gr.inputs.Dropdown(choices=["t5-base","t5-small","t5-large"], type="value", default="t5-base", label="model")
|
35 |
],
|
36 |
gr.outputs.Textbox(label="Output"),
|
37 |
examples=examples,
|