candle
candle copied to clipboard
Add BertForSequenceClassification with Native and WASM Examples
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 astringkey and an unsigned integer value, reflecting common Hugging Face model configurations.id2label: Modified inDebertaV2to 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