Instructions to use mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse
- SGLang
How to use mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse 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 "mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse" \ --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": "mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse", "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 "mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse" \ --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": "mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse with Docker Model Runner:
docker model run hf.co/mohammad-mozaffari/gemma_3_1b-PATCH-35Sparse
File size: 543 Bytes
b1c53d6 | 1 2 3 4 5 6 7 8 9 10 11 | This repository distributes ONLY a binary pruning mask (which weight
positions are kept vs. zeroed). It contains no weights from the base model.
The mask is a derivative of the base model listed in the model card and is
provided under that base model's license. You must independently obtain the base
model and comply with its license and acceptable-use policy.
Mask-generation code: MIT (https://github.com/Paramathic/patch).
MaskLLM baselines are our own re-implementation; the MaskLLM method is due to
Fang et al. (NVIDIA), NeurIPS 2024.
|