Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,12 +7,14 @@ description = "Gradio Demo for XLNet. To use it, simply add your text, or click
|
|
| 7 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/1906.08237' target='_blank'>XLNet: Generalized Autoregressive Pretraining for Language Understanding</a></p>"
|
| 8 |
|
| 9 |
examples = [
|
| 10 |
-
['Hello, my dog is cute','xlnet-base-cased']
|
|
|
|
|
|
|
| 11 |
]
|
| 12 |
|
| 13 |
io1 = gr.Interface.load("huggingface/xlnet-base-cased")
|
| 14 |
|
| 15 |
-
io2 = gr.Interface.load("huggingface/xlnet-
|
| 16 |
|
| 17 |
|
| 18 |
def inference(inputtext, model):
|
|
@@ -25,7 +27,7 @@ def inference(inputtext, model):
|
|
| 25 |
|
| 26 |
gr.Interface(
|
| 27 |
inference,
|
| 28 |
-
[gr.inputs.Textbox(label="Context",lines=10),gr.inputs.Dropdown(choices=["xlnet-base-cased","xlnet-
|
| 29 |
[gr.outputs.Textbox(label="Output")],
|
| 30 |
examples=examples,
|
| 31 |
article=article,
|
|
|
|
| 7 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/1906.08237' target='_blank'>XLNet: Generalized Autoregressive Pretraining for Language Understanding</a></p>"
|
| 8 |
|
| 9 |
examples = [
|
| 10 |
+
['Hello, my dog is cute','xlnet-base-cased'],
|
| 11 |
+
['从前,','chinese-xlnet-base']
|
| 12 |
+
|
| 13 |
]
|
| 14 |
|
| 15 |
io1 = gr.Interface.load("huggingface/xlnet-base-cased")
|
| 16 |
|
| 17 |
+
io2 = gr.Interface.load("huggingface/hfl/chinese-xlnet-base")
|
| 18 |
|
| 19 |
|
| 20 |
def inference(inputtext, model):
|
|
|
|
| 27 |
|
| 28 |
gr.Interface(
|
| 29 |
inference,
|
| 30 |
+
[gr.inputs.Textbox(label="Context",lines=10),gr.inputs.Dropdown(choices=["xlnet-base-cased","chinese-xlnet-base"], type="value", default="xlnet-base-cased", label="model")],
|
| 31 |
[gr.outputs.Textbox(label="Output")],
|
| 32 |
examples=examples,
|
| 33 |
article=article,
|