Text Generation
Transformers
Safetensors
English
gemma
unsloth
bnb
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use unsloth/codegemma-7b-bnb-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/codegemma-7b-bnb-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/codegemma-7b-bnb-4bit")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("unsloth/codegemma-7b-bnb-4bit") model = AutoModelForCausalLM.from_pretrained("unsloth/codegemma-7b-bnb-4bit", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use unsloth/codegemma-7b-bnb-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/codegemma-7b-bnb-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/codegemma-7b-bnb-4bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/unsloth/codegemma-7b-bnb-4bit
- SGLang
How to use unsloth/codegemma-7b-bnb-4bit 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 "unsloth/codegemma-7b-bnb-4bit" \ --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": "unsloth/codegemma-7b-bnb-4bit", "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 "unsloth/codegemma-7b-bnb-4bit" \ --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": "unsloth/codegemma-7b-bnb-4bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Desktop
- Docker Model Runner
How to use unsloth/codegemma-7b-bnb-4bit with Docker Model Runner:
docker model run hf.co/unsloth/codegemma-7b-bnb-4bit
Commit History
-
Upload tokenizer
Verified signaturefb9ae4d -
Upload config
Verified signature7a6a55e -
Upload config
Verified signaturef14612a
-
Upload tokenizer
Verified signature3c0965b -
Upload config
Verified signaturecf888cf -
Upload config
Verified signaturef1e3ce0
-
Upload tokenizer
Verified signature954fd2e -
Upload config
Verified signature6f72295 -
Upload config
Verified signatured557070
-
Upload tokenizer
Verified signaturebbdd476 -
Upload config
Verified signaturef14274f -
Upload config
Verified signature1f5cbdb
-
Upload tokenizer
Verified signature7a80654 -
Upload config
Verified signature29c26b3 -
Upload config
Verified signatureaa764b4
-
Upload tokenizer
Verified signature46e562d -
Upload config
Verified signaturefdf0bc6 -
Upload config
Verified signaturefcda83b
-
Upload tokenizer
Verified signaturef67aa33 -
Upload config
Verified signature7d42bff -
Upload config
Verified signature0a5b013
-
Upload tokenizer
Verified signaturef246544 -
Upload config
Verified signature5a1779c -
Upload config
Verified signature3069921 -
Upload tokenizer
Verified signaturefbecbca -
Upload config
Verified signature22c1964 -
Upload config
Verified signature8622799 -
Upload tokenizer
Verified signature388cd48 -
Upload config
Verified signature33b4010 -
Upload config
Verified signature3eedb8d
-
Upload tokenizer
Verified signature8225fc9
-
Update README.md
Verified signature31ca96e -
Upload tokenizer
Verified signature1529ca8 -
Upload GemmaForCausalLM
Verified signaturee957c14 -
initial commit
Verified signature0b7d99e