Instructions to use unsloth/codegemma-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/codegemma-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/codegemma-7b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("unsloth/codegemma-7b") model = AutoModelForCausalLM.from_pretrained("unsloth/codegemma-7b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use unsloth/codegemma-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/codegemma-7b" # 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", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/unsloth/codegemma-7b
- SGLang
How to use unsloth/codegemma-7b 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" \ --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", "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" \ --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", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Desktop
- Docker Model Runner
How to use unsloth/codegemma-7b with Docker Model Runner:
docker model run hf.co/unsloth/codegemma-7b
Commit History
-
Upload tokenizer
Verified signature93a0a77 -
Upload config
Verified signature964ef66 -
Upload config
Verified signature7aa651f
-
Upload tokenizer
Verified signature9a9f1dc -
Upload config
Verified signature2bfeca8 -
Upload config
Verified signature6eef0ec
-
Upload tokenizer
Verified signatureea53016 -
Upload config
Verified signaturef34c221 -
Upload config
Verified signature4aaae13
-
Upload tokenizer
Verified signature807a10e -
Upload config
Verified signaturefdc9969 -
Upload config
Verified signature7207c23
-
Upload tokenizer
Verified signature6b08825 -
Upload config
Verified signature621438b -
Upload config
Verified signaturec5017d8
-
Upload tokenizer
Verified signaturecbb424a -
Upload config
Verified signature6fea2d2 -
Upload config
Verified signaturea6003f0
-
Upload tokenizer
Verified signature632e104 -
Upload config
Verified signature50bfef8 -
Upload config
Verified signature0d0287b
-
Upload tokenizer
Verified signature49f5049 -
Upload config
Verified signaturebc95380 -
Upload config
Verified signature302439f -
Upload tokenizer
Verified signaturee1d6ec5 -
Upload config
Verified signature77067f1 -
Upload config
Verified signaturec209330 -
Upload tokenizer
Verified signature0367060 -
Upload config
Verified signature58624f6 -
Upload config
Verified signaturec096430
-
Upload tokenizer
Verified signature9682910
-
Update README.md
Verified signature0d14121 -
Upload tokenizer
Verified signature95a0380 -
Upload GemmaForCausalLM
Verified signaturef3852d4 -
initial commit
Verified signaturedaf7dc7