Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,17 +8,17 @@ import gradio as gr
|
|
8 |
model_name = "MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7"
|
9 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
10 |
|
11 |
-
def clasificador(
|
12 |
classifier = pipeline("zero-shot-classification", model="MoritzLaurer/mDeBERTa-v3-base-mnli-xnli",tokenizer=tokenizer)
|
13 |
-
sequence_to_classify =
|
14 |
-
candidate_labels =
|
15 |
output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
|
16 |
return output
|
17 |
|
18 |
|
19 |
iface = gr.Interface(
|
20 |
fn=clasificador,
|
21 |
-
inputs=gr.inputs.Textbox(label="Ingrese texto"),
|
22 |
outputs=gr.outputs.Textbox(label="Clasificación")
|
23 |
)
|
24 |
|
|
|
8 |
model_name = "MoritzLaurer/mDeBERTa-v3-base-xnli-multilingual-nli-2mil7"
|
9 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
10 |
|
11 |
+
def clasificador(input1, input2):
|
12 |
classifier = pipeline("zero-shot-classification", model="MoritzLaurer/mDeBERTa-v3-base-mnli-xnli",tokenizer=tokenizer)
|
13 |
+
sequence_to_classify = input1
|
14 |
+
candidate_labels = input2
|
15 |
output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
|
16 |
return output
|
17 |
|
18 |
|
19 |
iface = gr.Interface(
|
20 |
fn=clasificador,
|
21 |
+
inputs=[gr.inputs.Textbox(label="Ingrese texto"),gr.inputs.List(gr.inputs.Textbox(label="Ingrese lista de labels"))],
|
22 |
outputs=gr.outputs.Textbox(label="Clasificación")
|
23 |
)
|
24 |
|