Text Generation
Transformers
Safetensors
PyTorch
English
gelu_gpt
gpt
gelu
261M
chinchilla
ablation
seed2
custom_code
Instructions to use mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch
- SGLang
How to use mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch 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 "mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch" \ --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": "mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch", "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 "mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch" \ --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": "mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch with Docker Model Runner:
docker model run hf.co/mlnomad/gelu-d12-chinchilla-261M-seed2-pytorch
Fix HF dynamic_module_utils: replace `from ..X` with `from torch_port.X` (try) + bare `from X` (except)
Browse files- modeling_gelu_gpt.py +3 -3
modeling_gelu_gpt.py
CHANGED
|
@@ -25,10 +25,10 @@ from transformers.generation import GenerationMixin
|
|
| 25 |
|
| 26 |
try:
|
| 27 |
from .configuration_gelu_gpt import GeluGPTConfig
|
|
|
|
|
|
|
|
|
|
| 28 |
from torch_port.torch_gpt import GELU_GPT, GPTConfig, rms_norm, apply_rotary_emb, has_ve, compute_window_sizes
|
| 29 |
-
except ImportError: # when loaded as flat files via trust_remote_code
|
| 30 |
-
from configuration_gelu_gpt import GeluGPTConfig
|
| 31 |
-
from torch_gpt import GELU_GPT, GPTConfig, rms_norm, apply_rotary_emb, has_ve, compute_window_sizes
|
| 32 |
|
| 33 |
|
| 34 |
def _kvcache_attn(
|
|
|
|
| 25 |
|
| 26 |
try:
|
| 27 |
from .configuration_gelu_gpt import GeluGPTConfig
|
| 28 |
+
from .torch_gpt import GELU_GPT, GPTConfig, rms_norm, apply_rotary_emb, has_ve, compute_window_sizes
|
| 29 |
+
except ImportError:
|
| 30 |
+
from torch_port.gelu.configuration_gelu_gpt import GeluGPTConfig
|
| 31 |
from torch_port.torch_gpt import GELU_GPT, GPTConfig, rms_norm, apply_rotary_emb, has_ve, compute_window_sizes
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
|
| 34 |
def _kvcache_attn(
|