Skip to content

Add BertForSequenceClassification with Native and WASM Examples #2857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sondalex
Copy link

@sondalex sondalex commented Apr 1, 2025

This pull request introduces the BertForSequenceClassification model. It includes two examples to demonstrate its functionality:

  • A native implementation example.
  • A WebAssembly (WASM) example, which also supports ModernBert.

Additionally, the following type adjustments have been made to align with common conventions observed in Hugging Face models:

  • label2id: Updated to use a string key and an unsigned integer value, reflecting common Hugging Face model configurations.
  • id2label: Modified in DebertaV2 to use a string key and a string value, consistent with Hugging Face model configurations

Note: The WASM example depends on methods not yet available in the main branch of the upstream tokenizers repository.
It is compatible with changes proposed in huggingface/tokenizers#1758

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.

1 participant