Text Classification
Transformers
Safetensors
Laya
Arabic
modernbert
feature-extraction
arabic
nlu
intent-classification
natural-language-inference
custom_code
Eval Results (legacy)
Instructions to use Wouze/laya-ara with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Wouze/laya-ara with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Wouze/laya-ara", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("Wouze/laya-ara", trust_remote_code=True) model = AutoModel.from_pretrained("Wouze/laya-ara", trust_remote_code=True, device_map="auto") - Laya
How to use Wouze/laya-ara with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download tokenization_laya.py from Wouze/laya-ara: direct link, hf CLI and curl.
- Browser
- Download file 671 Bytes
-
https://huggingface.co/Wouze/laya-ara/resolve/main/tokenization_laya.py
- Command line
-
hf download hf://Wouze/laya-ara/tokenization_laya.py
-
curl -L -o tokenization_laya.py https://huggingface.co/Wouze/laya-ara/resolve/main/tokenization_laya.py
671 Bytes
| """Point AutoTokenizer at tokenizer/, where the Laya checkpoint keeps it.""" | |
| class LayaTokenizer: | |
| def register_for_auto_class(cls, auto_class="AutoTokenizer"): | |
| return | |
| def from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs): | |
| for key in ("trust_remote_code", "config", "subfolder", "_from_auto", "code_revision"): | |
| kwargs.pop(key, None) | |
| from transformers import PreTrainedTokenizerFast | |
| return PreTrainedTokenizerFast.from_pretrained( | |
| pretrained_model_name_or_path, | |
| *inputs, | |
| subfolder="tokenizer", | |
| **kwargs, | |
| ) | |