Instructions to use vllm/tiny-random-Gemma2ForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vllm/tiny-random-Gemma2ForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vllm/tiny-random-Gemma2ForCausalLM")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("vllm/tiny-random-Gemma2ForCausalLM") model = AutoModelForCausalLM.from_pretrained("vllm/tiny-random-Gemma2ForCausalLM", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use vllm/tiny-random-Gemma2ForCausalLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vllm/tiny-random-Gemma2ForCausalLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vllm/tiny-random-Gemma2ForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/vllm/tiny-random-Gemma2ForCausalLM
- SGLang
How to use vllm/tiny-random-Gemma2ForCausalLM 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 "vllm/tiny-random-Gemma2ForCausalLM" \ --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": "vllm/tiny-random-Gemma2ForCausalLM", "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 "vllm/tiny-random-Gemma2ForCausalLM" \ --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": "vllm/tiny-random-Gemma2ForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use vllm/tiny-random-Gemma2ForCausalLM with Docker Model Runner:
docker model run hf.co/vllm/tiny-random-Gemma2ForCausalLM
Upload Gemma2ForCausalLM
Browse files- config.json +2 -2
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -17,8 +17,8 @@
|
|
| 17 |
"intermediate_size": 64,
|
| 18 |
"max_position_embeddings": 8192,
|
| 19 |
"model_type": "gemma2",
|
| 20 |
-
"num_attention_heads":
|
| 21 |
-
"num_hidden_layers":
|
| 22 |
"num_key_value_heads": 2,
|
| 23 |
"pad_token_id": 0,
|
| 24 |
"query_pre_attn_scalar": 224,
|
|
|
|
| 17 |
"intermediate_size": 64,
|
| 18 |
"max_position_embeddings": 8192,
|
| 19 |
"model_type": "gemma2",
|
| 20 |
+
"num_attention_heads": 4,
|
| 21 |
+
"num_hidden_layers": 8,
|
| 22 |
"num_key_value_heads": 2,
|
| 23 |
"pad_token_id": 0,
|
| 24 |
"query_pre_attn_scalar": 224,
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:311f2d2982f2f8b3d8b8d32cc5981a3bb347938503b340420f3a29ade335afdd
|
| 3 |
+
size 16887504
|