Instructions to use Velkamez/tamazight-unigram with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Velkamez/tamazight-unigram with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Velkamez/tamazight-unigram", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Velkamez/tamazight-unigram", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Velkamez/tamazight-unigram with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Velkamez/tamazight-unigram" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Velkamez/tamazight-unigram", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Velkamez/tamazight-unigram
- SGLang
How to use Velkamez/tamazight-unigram with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Velkamez/tamazight-unigram" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Velkamez/tamazight-unigram", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Velkamez/tamazight-unigram" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Velkamez/tamazight-unigram", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Velkamez/tamazight-unigram with Docker Model Runner:
docker model run hf.co/Velkamez/tamazight-unigram
Tamazight Causal Language Model Overview TamazightForCausalLM is a custom autoregressive language model trained for Tamazight text generation. This model uses: Custom architecture: TamazightForCausalLM Custom tokenizer based on SentencePiece (.model) Fully integrated with Transformers Supports generate() (sampling, greedy, beam search) Model Details Architecture: Decoder-only Transformer Model type: tamazight Tokenizer: SentencePiece unigram Special Tokens: Files Included Copy code
config.json generation_config.json model.safetensors tokenizer_config.json tamazight.model
configuration_tamazight.py modeling_tamazight.py tokenization_tamazight.py init.py Installation Bash Copy code pip install transformers torch Usage Because this is a custom architecture, you must enable trust_remote_code=True. Python Copy code from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained( "YOUR_USERNAME/tamazight-model", trust_remote_code=True )
model = AutoModelForCausalLM.from_pretrained( "YOUR_USERNAME/tamazight-model", trust_remote_code=True )
inputs = tokenizer("azul fellak", return_tensors="pt")
outputs = model.generate( **inputs, max_new_tokens=50, do_sample=True, temperature=0.8 )
print(tokenizer.decode(outputs[0], skip_special_tokens=True)) Training Trained from scratch Tokenizer trained using SentencePiece Special token IDs aligned with model config Compatible with modern Transformers versions Notes Special token IDs are defined in config.json Generation settings are stored in generation_config.json Embeddings are aligned with tokenizer vocabulary size Fully portable via save_pretrained() / from_pretrained() License Specify your license here (e.g., MIT, Apache 2.0). Acknowledgments Built using the Transformers library by Hugging Face.
- Downloads last month
- 6