Skip to content

Conversation

@tomaarsen
Copy link
Member

Hello!

Pull Request overview

  • Add SetFitModel.labels, SetFitModel.label2id, SetFitModel.id2label.
  • By default, use labels in model.predict. Can be disabled with model.predict(use_labels=False).
  • Save normalize_embeddings and labels in a config_setfit.json file.
  • Move config_setfit_span.json contents (i.e. span_context) to config_setfit.json.
  • Fix for wrong device with training with a differentiable head.

Details

The core of this PR is to allow:

model = SetFitModel.from_pretrained("tomaarsen/setfit-bge-small-v1.5-sst2-8-shot")
preds = model.predict([
    "It's a charming and often affecting journey.",
    "It's slow -- very, very slow.",
    "A sometimes tedious film.",
])
print(preds)
# ['positive', 'negative', 'negative']

i.e. get string outputs.

  • Tom Aarsen

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@tomaarsen tomaarsen merged commit 298fe39 into huggingface:v1.0.0-pre Nov 29, 2023
@tomaarsen tomaarsen deleted the feat/configuration branch November 29, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants