Instructions to use testmoto/gemma-2-9b-synthetic_coding with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use testmoto/gemma-2-9b-synthetic_coding with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="testmoto/gemma-2-9b-synthetic_coding")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("testmoto/gemma-2-9b-synthetic_coding") model = AutoModelForCausalLM.from_pretrained("testmoto/gemma-2-9b-synthetic_coding", device_map="auto") - MLX
How to use testmoto/gemma-2-9b-synthetic_coding with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("testmoto/gemma-2-9b-synthetic_coding") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- vLLM
How to use testmoto/gemma-2-9b-synthetic_coding with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "testmoto/gemma-2-9b-synthetic_coding" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "testmoto/gemma-2-9b-synthetic_coding", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/testmoto/gemma-2-9b-synthetic_coding
- SGLang
How to use testmoto/gemma-2-9b-synthetic_coding 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 "testmoto/gemma-2-9b-synthetic_coding" \ --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": "testmoto/gemma-2-9b-synthetic_coding", "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 "testmoto/gemma-2-9b-synthetic_coding" \ --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": "testmoto/gemma-2-9b-synthetic_coding", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - MLX LM
How to use testmoto/gemma-2-9b-synthetic_coding with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "testmoto/gemma-2-9b-synthetic_coding" --prompt "Once upon a time"
- Docker Model Runner
How to use testmoto/gemma-2-9b-synthetic_coding with Docker Model Runner:
docker model run hf.co/testmoto/gemma-2-9b-synthetic_coding
- Atomic Chat
Commit History
-
Upload folder using huggingface_hub (#2)
Verified signature- cac3b67351662553a51248835541627d5823cf2a2dbb582a63e55907b0e390aa (66d9e5bafd25c14288e0e972975dc117b9b89d57) - 06879d071cd2afee9aa5cc192d702f479524b25d6b3efff6831fc1a6b42f9115 (1a18336baad69ce96e66714384ba6f852bd531c1) - b087aca70af33b629ec31b7fa8da59fbe357c6a5737f7d6f9a9e8ddebe8bd7ea (a70515fbeaecc509357a92955434dd8695cdbc63) - 469922409d5df32345298a62413c5dd5e464c61af5b027aecad03db4cd22c4ca (625a835e3a45839fdb972516cb53c400f55a07c9) - dd076ce54486cba8703c1cfdfdd47747e4ff14f752770ee24ea23dcde3c3db18 (959b20ac8926462d0f49a633a9914f0f14f52e66) - b0464e071f4da84c0788fc40838e2fb244561822e696451fb429c2b8158e6c16 (941d122bee5029889d5c8158f4ef7cc69008fc58) - 38127328d41dd1f02d9519094126f812defec5f3dff55f18c45ef44db2d453a4 (a59af7ebc5d8fc77e2865f30a974c7502e13473f) - c4982a98a9c8917f6eb78f18770fd5de072c9a09331ad56a9478ae61c8c6c389 (cd0df1567d0f123025430f69610fdab7fa9efe54)9cdc857