Instructions to use ping98k/gemma-han-2b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ping98k/gemma-han-2b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ping98k/gemma-han-2b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ping98k/gemma-han-2b") model = AutoModelForCausalLM.from_pretrained("ping98k/gemma-han-2b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ping98k/gemma-han-2b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf ping98k/gemma-han-2b:Q4_K_M # Run inference directly in the terminal: llama cli -hf ping98k/gemma-han-2b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ping98k/gemma-han-2b:Q4_K_M # Run inference directly in the terminal: llama cli -hf ping98k/gemma-han-2b:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf ping98k/gemma-han-2b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf ping98k/gemma-han-2b:Q4_K_M
Use Docker
docker model run hf.co/ping98k/gemma-han-2b:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use ping98k/gemma-han-2b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ping98k/gemma-han-2b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ping98k/gemma-han-2b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ping98k/gemma-han-2b:Q4_K_M
- SGLang
How to use ping98k/gemma-han-2b 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 "ping98k/gemma-han-2b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ping98k/gemma-han-2b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "ping98k/gemma-han-2b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ping98k/gemma-han-2b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use ping98k/gemma-han-2b with Ollama:
ollama run hf.co/ping98k/gemma-han-2b:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use ping98k/gemma-han-2b with Docker Model Runner:
docker model run hf.co/ping98k/gemma-han-2b:Q4_K_M
- Lemonade
How to use ping98k/gemma-han-2b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ping98k/gemma-han-2b:Q4_K_M
Run and chat with the model
lemonade run user.gemma-han-2b-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Commit History
-
Update README.md
Verified signature74e9014 -
Update README.md
Verified signature44da289 -
Update README.md
Verified signatureaca0d0a -
Update README.md
Verified signature8baba97 -
Update README.md
Verified signature345ec86 -
Update README.md
Verified signature72034f5 -
Rename model-unsloth.Q4_K_M.gguf to gemma-han-2b.Q4_K_M.gguf
Verified signature98436be -
Upload model-unsloth.Q4_K_M.gguf
Verified signature75431e6 -
Upload 4 files
Verified signature5c05867 -
Update README.md
Verified signature44c0d99 -
Upload 9 files
Verified signature6bd7e1c -
Delete adapter_model.safetensors
Verified signature486be05 -
Delete adapter_config.json
Verified signature5ee11f3 -
Upload config.json
Verified signature3fcfcd7 -
Upload 4 files
Verified signaturea73b371 -
Upload tokenizer_config.json
Verified signature98cd377 -
Update README.md
Verified signature70530c2 -
Upload 3 files
Verified signaturee27dde2 -
Delete .gitattributes
Verified signature150c47e -
Delete README.md
Verified signature40fbeaa -
Delete tokenizer_config.json
Verified signaturea348501 -
Delete tokenizer.model
Verified signature79fc671 -
Delete tokenizer.json
Verified signaturec0b52b6 -
Delete special_tokens_map.json
Verified signature51379e0 -
Delete model.safetensors.index.json
Verified signature57c01db -
Delete generation_config.json
Verified signaturecce7d76 -
Delete model-00002-of-00002.safetensors
Verified signature70f183f -
Delete model-00001-of-00002.safetensors
Verified signaturea69ff3f -
Delete config.json
Verified signature1509d4c -
Update README.md
Verified signature00a5e1f -
Update README.md
Verified signaturec54406c -
Update README.md
Verified signature1503354 -
Update README.md
Verified signature54fcb21 -
Upload 9 files
Verified signatureee72743 -
Delete tokenizer_config.json
Verified signaturea605481 -
Delete tokenizer.model
Verified signature3e0e113 -
Delete tokenizer.json
Verified signature213045c -
Delete special_tokens_map.json
Verified signature4013945 -
Delete model.safetensors.index.json
Verified signature3b7c99c -
Delete model-00002-of-00002.safetensors
Verified signature8ba6feb -
Delete model-00001-of-00002.safetensors
Verified signature7084623 -
Delete generation_config.json
Verified signature1725b42 -
Delete config.json
Verified signature6c222f2 -
Delete gemma-han-2b.Q4_K_M.gguf
Verified signature7f710b4 -
Delete adapter_model.safetensors
Verified signaturea64c119 -
Delete adapter_config.json
Verified signatureeb5c01f -
Upload 9 files
Verified signature2d952f8
-
Update README.md
Verified signature96372bd -
Upload 3 files
Verified signature6d1f3e9 -
Update README.md
Verified signature0cb41bb