Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,10 +4,12 @@ classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnl
|
|
| 4 |
|
| 5 |
st.title("What's the category?")
|
| 6 |
|
|
|
|
|
|
|
| 7 |
text = st.text_input("Enter words")
|
| 8 |
|
| 9 |
-
if text is not None and text
|
| 10 |
-
candidate_labels =
|
| 11 |
res = classifier(text, candidate_labels)
|
| 12 |
|
| 13 |
for index, name in enumerate(res['labels']):
|
|
|
|
| 4 |
|
| 5 |
st.title("What's the category?")
|
| 6 |
|
| 7 |
+
|
| 8 |
+
cats = st.text_input("Enter categories (comma separated)")
|
| 9 |
text = st.text_input("Enter words")
|
| 10 |
|
| 11 |
+
if text is not None and text != "":
|
| 12 |
+
candidate_labels = cats.split(",")
|
| 13 |
res = classifier(text, candidate_labels)
|
| 14 |
|
| 15 |
for index, name in enumerate(res['labels']):
|