Downloads · 30 days
6
2% of all-time downloads
zeroshot/sst2-distilbert-sparse
sst2-distilbert-sparse is a text classification model from zeroshot. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
6
2% of all-time downloads
All-time downloads
285
Public
Repo size
67.2 MB
Likes
0
Public
Click a slice to open those files.
.onnx67.2 MB · 99%
From the Hugging Face model README
This model is 👇
███████╗ ██████╗ █████╗ ██████╗ ███████╗ ███████╗
██╔════╝ ██╔══██╗ ██╔══██╗ ██╔══██╗ ██╔════╝ ██╔════╝
███████╗ ██████╔╝ ███████║ ██████╔╝ ███████╗ █████╗
╚════██║ ██╔═══╝ ██╔══██║ ██╔══██╗ ╚════██║█ █╔══╝
███████║ ██║ ██║ ██║ ██║ ██ ║███████║ ███████╗
╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═ ╝╚══════╝ ╚══════╝



class EndpointHandler:
def __init__(self, path=""):
self.pipeline = Pipeline.create(task="text-classification", model_path=path)
def __call__(self, data: Dict[str, Any]) -> Dict[str, str]:
"""
Args:
data (:obj:): prediction input text
"""
inputs = data.pop("inputs", data)
start = perf_counter()
prediction = self.pipeline(inputs)
end = perf_counter()
latency = end - start
return {
"labels": prediction.labels,
"scores": prediction.scores,
"latency (secs.)": latency
}
̷͈̍ ̵̳͒R̶̙̓i̸̟͘c̴̻̆k̸̑͜ÿ̷̳́ ̸̪̚ ̷͖̀