Text Generation
Transformers
Safetensors
English
gemma2
gemma
rl-mpq
mixed-precision
quantization
fake-quantization
conservative
text-generation-inference
Instructions to use AvoCahDoe/gemma-2-9b-rlmpq-conservative with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AvoCahDoe/gemma-2-9b-rlmpq-conservative with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AvoCahDoe/gemma-2-9b-rlmpq-conservative")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AvoCahDoe/gemma-2-9b-rlmpq-conservative") model = AutoModelForCausalLM.from_pretrained("AvoCahDoe/gemma-2-9b-rlmpq-conservative", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AvoCahDoe/gemma-2-9b-rlmpq-conservative with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AvoCahDoe/gemma-2-9b-rlmpq-conservative" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AvoCahDoe/gemma-2-9b-rlmpq-conservative", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AvoCahDoe/gemma-2-9b-rlmpq-conservative
- SGLang
How to use AvoCahDoe/gemma-2-9b-rlmpq-conservative 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 "AvoCahDoe/gemma-2-9b-rlmpq-conservative" \ --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": "AvoCahDoe/gemma-2-9b-rlmpq-conservative", "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 "AvoCahDoe/gemma-2-9b-rlmpq-conservative" \ --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": "AvoCahDoe/gemma-2-9b-rlmpq-conservative", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AvoCahDoe/gemma-2-9b-rlmpq-conservative with Docker Model Runner:
docker model run hf.co/AvoCahDoe/gemma-2-9b-rlmpq-conservative
| { | |
| "slug": "gemma_2_9b", | |
| "hf_id": "google/gemma-2-9b", | |
| "scenario": "Conservative", | |
| "params": { | |
| "lambda_mse": 1.0, | |
| "lambda_bit": 0.15, | |
| "max_mse_clip": 1.0, | |
| "target_bits": 5.5, | |
| "lambda_budget": 3.0 | |
| }, | |
| "policy": [ | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 4, | |
| 8, | |
| 8, | |
| 8, | |
| 8, | |
| 8, | |
| 8, | |
| 8, | |
| 8, | |
| 8, | |
| 8, | |
| 8, | |
| 8 | |
| ], | |
| "num_layers": 42, | |
| "avg_bits": 5.1429, | |
| "total_reward": -4.732356, | |
| "compression_ratio": 3.1111, | |
| "approx_size_gb": 5.786, | |
| "bit_distribution": { | |
| "4": 30, | |
| "8": 12 | |
| }, | |
| "avg_mse_per_bit": { | |
| "4": 0.02755521, | |
| "8": 3.639e-05 | |
| }, | |
| "validation_elapsed_s": 0.0121, | |
| "policy_source": "/workspace/RL-NMP-Model-Quantasation/phase3/models/gemma_2_9b/results/Conservative_policy.json", | |
| "policy_path": "/workspace/RL-NMP-Model-Quantasation/phase3/models/gemma_2_9b/results/Conservative_policy.json", | |
| "training_run": "20260610_202902" | |
| } |