candle icon indicating copy to clipboard operation
candle copied to clipboard

Add BertForSequenceClassification with Native and WASM Examples

Open sondalex opened this issue 8 months ago • 0 comments

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 https://github.com/huggingface/tokenizers/pull/1758

sondalex avatar Apr 01 '25 06:04 sondalex