Instructions to use pandeyps/Gemma with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pandeyps/Gemma with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pandeyps/Gemma")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("pandeyps/Gemma") model = AutoModelForCausalLM.from_pretrained("pandeyps/Gemma", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pandeyps/Gemma with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pandeyps/Gemma" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pandeyps/Gemma", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/pandeyps/Gemma
- SGLang
How to use pandeyps/Gemma 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 "pandeyps/Gemma" \ --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": "pandeyps/Gemma", "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 "pandeyps/Gemma" \ --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": "pandeyps/Gemma", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use pandeyps/Gemma with Docker Model Runner:
docker model run hf.co/pandeyps/Gemma
File size: 1,220 Bytes
aa2bdaa 4fffdf4 33c8c48 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | ---
language:
- en
license: mit
library_name: transformers
tags:
- gemma
- text-generation
- transformer
datasets:
- karpathy/tiny_shakespeare
metrics:
- cross_entropy
---
scaled down version of the **Gemma** architecture trained on the **Tiny Shakespeare** dataset.
## Model
- **Architecture**: Gemma (Transformer Decoder)
- **Attention**: Multi Query Attention (MQA)
- **Hidden Size**: 768
- **Number of Layers**: 12
- **Number of Query Heads**: 2
- **Number of KV Heads**: 1
- **Sequence Length**: 128 (Block Size)
- **Vocabulary Size**: 65 (Character-level encoding)
- **Total Training Steps**: 3,500
## Architecture
1. **RMSNorm**
2. **GeGLU**
3. **RoPE**
4. **Embedding Scaling**
## Usage
You can load this model directly using the Hugging Face `transformers` library:
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("parkneurals/Gemma")
# Note: This model uses a custom character-level tokenizer.
# You can use the provided char_map.json for encoding/decoding.
```
### This model has slow inference due to rotation matrix calcuation on every layer for each token(as I made it only for learning purposes; please bear if anyone using) |