Instructions to use DarkSca/GenZ_BitNet with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DarkSca/GenZ_BitNet with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DarkSca/GenZ_BitNet", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("DarkSca/GenZ_BitNet", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("DarkSca/GenZ_BitNet", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use DarkSca/GenZ_BitNet with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DarkSca/GenZ_BitNet" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DarkSca/GenZ_BitNet", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/DarkSca/GenZ_BitNet
- SGLang
How to use DarkSca/GenZ_BitNet 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 "DarkSca/GenZ_BitNet" \ --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": "DarkSca/GenZ_BitNet", "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 "DarkSca/GenZ_BitNet" \ --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": "DarkSca/GenZ_BitNet", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use DarkSca/GenZ_BitNet with Docker Model Runner:
docker model run hf.co/DarkSca/GenZ_BitNet
| { | |
| "architectures": [ | |
| "BitNetForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "auto_map": { | |
| "AutoConfig": "configuration_bitnet.BitNetConfig", | |
| "AutoModelForCausalLM": "modeling_bitnet.BitNetForCausalLM" | |
| }, | |
| "bos_token_id": 128000, | |
| "dtype": "float32", | |
| "eos_token_id": 128001, | |
| "hidden_act": "relu2", | |
| "hidden_size": 2560, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 6912, | |
| "max_position_embeddings": 4096, | |
| "model_type": "bitnet", | |
| "num_attention_heads": 20, | |
| "num_hidden_layers": 30, | |
| "num_key_value_heads": 5, | |
| "quantization_config": { | |
| "linear_class": "autobitlinear", | |
| "modules_to_not_convert": null, | |
| "quant_method": "bitnet", | |
| "quantization_mode": "online", | |
| "rms_norm_eps": 1e-06, | |
| "use_rms_norm": false | |
| }, | |
| "rms_norm_eps": 1e-05, | |
| "rope_theta": 500000.0, | |
| "tie_word_embeddings": true, | |
| "transformers_version": "4.57.1", | |
| "use_cache": true, | |
| "vocab_size": 128256 | |
| } | |