Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,14 +4,12 @@ from transformers import pipeline
|
|
4 |
st.title("Text Classifier - BART-Large-MNLI")
|
5 |
st.write("Input text and labels. Submit. The machine will classify the text according to the labels.")
|
6 |
|
7 |
-
classifier = pipeline("zero-shot-classification", model=
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
labels = form.text_input(label='Labels')
|
12 |
-
submit_button = form.form_submit_button(label='Submit')
|
13 |
|
14 |
-
if
|
15 |
labs = labels.title().split(',')
|
16 |
text = input_text.title()
|
17 |
res = classifier(text, labs)
|
|
|
4 |
st.title("Text Classifier - BART-Large-MNLI")
|
5 |
st.write("Input text and labels. Submit. The machine will classify the text according to the labels.")
|
6 |
|
7 |
+
classifier = pipeline(task="zero-shot-classification", device=0, model="facebook/bart-large-mnli")
|
8 |
|
9 |
+
input_text = st.text_input(label='Input Text')
|
10 |
+
labels = st.text_input(label='Labels')
|
|
|
|
|
11 |
|
12 |
+
if st.button("Submit"):
|
13 |
labs = labels.title().split(',')
|
14 |
text = input_text.title()
|
15 |
res = classifier(text, labs)
|