Spaces:
Runtime error
Runtime error
Ahsen Khaliq
commited on
Commit
·
d2e2101
1
Parent(s):
4d5c4f0
Update app.py
Browse files
app.py
CHANGED
@@ -10,4 +10,25 @@ examples = [
|
|
10 |
["Paris is the capital of France"]
|
11 |
]
|
12 |
|
13 |
-
gr.Interface.load("huggingface/facebook/mbart-large-50-one-to-many-mmt"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
["Paris is the capital of France"]
|
11 |
]
|
12 |
|
13 |
+
io1 = gr.Interface.load("huggingface/facebook/mbart-large-50-one-to-many-mmt")
|
14 |
+
|
15 |
+
io2 = gr.Interface.load("huggingface/facebook/facebook/mbart-large-50")
|
16 |
+
|
17 |
+
def inference(text, model):
|
18 |
+
if model == "mbart-large-50-one-to-many-mmt":
|
19 |
+
outtext = io1(text)
|
20 |
+
else:
|
21 |
+
outtext = io2(text)
|
22 |
+
return outtext
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
gr.Interface(
|
27 |
+
inference,
|
28 |
+
[gr.inputs.Textbox(label="Input"),gr.inputs.Dropdown(choices=["mbart-large-50-one-to-many-mmt","mbart-large-50"], type="value", default="mbart-large-50-one-to-many-mmt", label="model")
|
29 |
+
],
|
30 |
+
gr.outputs.Textbox(label="Output"),
|
31 |
+
examples=examples,
|
32 |
+
article=article,
|
33 |
+
title=title,
|
34 |
+
description=description).launch(enable_queue=True, cache_examples=True)
|