Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
title = "Text Classifier 2 - BART-Large-MNLI"
|
4 |
+
description = "Input text and labels. Submit."
|
5 |
+
|
6 |
+
io1 = gr.Interface.load("huggingface/facebook/bart-large-mnli")
|
7 |
+
|
8 |
+
def inference(text, model,class_names,allow_multiple):
|
9 |
+
outlabel = io1(text,class_names,allow_multiple)
|
10 |
+
outtext = ""
|
11 |
+
return outlabel, outtext
|
12 |
+
|
13 |
+
gr.Interface(
|
14 |
+
inference,
|
15 |
+
[gr.inputs.Textbox(label="Input",lines=10),gr.inputs.Textbox(label="Possible class names (comma-separated)"),gr.inputs.Checkbox(default=False, label="Allow multiple true classes")],
|
16 |
+
[gr.outputs.Label(label="Zero-Shot Classification"),gr.outputs.Textbox(label="Summarization")],
|
17 |
+
title=title,
|
18 |
+
description=description).launch(enable_queue=True, cache_examples=True)
|