Spaces:
Runtime error
Runtime error
Download app.py from Alex3456/ZeroShotClassification: direct link, hf CLI and curl.
- Browser
- Download file 324 Bytes
-
https://huggingface.co/spaces/Alex3456/ZeroShotClassification/resolve/main/app.py
- Command line
-
hf download hf://spaces/Alex3456/ZeroShotClassification/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Alex3456/ZeroShotClassification/resolve/main/app.py
324 Bytes
| import streamlit as st | |
| import transformers | |
| from transformers import pipeline | |
| classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli") | |
| sequence_to_classify = st.text_area("Enter the text here") | |
| candidate_labels = ['travel', 'cooking', 'dancing'] | |
| classifier(sequence_to_classify, candidate_labels) |