Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,14 +11,15 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
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 |
-
|
|
|
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.
|
22 |
outputs=gr.outputs.Textbox(label="Clasificación")
|
23 |
)
|
24 |
|
|
|
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 |
+
input2_list = input2.split(",") # Parse the input string as a list
|
15 |
+
candidate_labels= [item.strip() for item in input2_list]
|
16 |
output = classifier(sequence_to_classify, candidate_labels, multi_label=False)
|
17 |
return output
|
18 |
|
19 |
|
20 |
iface = gr.Interface(
|
21 |
fn=clasificador,
|
22 |
+
inputs=[gr.inputs.Textbox(label="Ingrese texto"),gr.inputs.Textbox(label="Ingrese lista de labels")],
|
23 |
outputs=gr.outputs.Textbox(label="Clasificación")
|
24 |
)
|
25 |
|