Instructions to use dappradar/setfit-collections-multilabel with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use dappradar/setfit-collections-multilabel with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("dappradar/setfit-collections-multilabel") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - setfit
How to use dappradar/setfit-collections-multilabel with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("dappradar/setfit-collections-multilabel") preds = model.predict(["i loved the spiderman movie!", "pineapple on pizza is the worst"]) print(preds) - Notebooks
- Google Colab
- Kaggle
File size: 345 Bytes
d10d642 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | from handler import EndpointHandler
# init handler
my_handler = EndpointHandler(path=".")
# prepare sample payload
non_holiday_payload = {"inputs": "I am quite excited how this will turn out", "date": "2022-08-08"}
# test the handler
non_holiday_pred=my_handler(non_holiday_payload)
# show results
print("non_holiday_pred", non_holiday_pred) |