Text Generation
Transformers
Safetensors
PyTorch
English
pebble_25m
pebble
language-model
base-model
small-language-model
custom-code
mamba2
hybrid
custom_code
Instructions to use basically-ai/Pebble-25M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use basically-ai/Pebble-25M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="basically-ai/Pebble-25M", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("basically-ai/Pebble-25M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use basically-ai/Pebble-25M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "basically-ai/Pebble-25M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "basically-ai/Pebble-25M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/basically-ai/Pebble-25M
- SGLang
How to use basically-ai/Pebble-25M 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 "basically-ai/Pebble-25M" \ --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": "basically-ai/Pebble-25M", "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 "basically-ai/Pebble-25M" \ --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": "basically-ai/Pebble-25M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use basically-ai/Pebble-25M with Docker Model Runner:
docker model run hf.co/basically-ai/Pebble-25M
Update config.json
Browse files- config.json +27 -17
config.json
CHANGED
|
@@ -1,22 +1,32 @@
|
|
| 1 |
{
|
| 2 |
-
"model_type": "pebble_25m",
|
| 3 |
"architectures": [
|
| 4 |
-
"
|
| 5 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
"vocab_size": 2048,
|
| 7 |
-
"
|
| 8 |
-
"
|
| 9 |
-
"
|
| 10 |
-
"
|
| 11 |
-
"
|
| 12 |
-
"
|
| 13 |
-
"
|
| 14 |
-
"
|
| 15 |
-
"
|
| 16 |
-
"
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
+
"PebbleForCausalLM"
|
| 4 |
],
|
| 5 |
+
"model_type": "pebble_25m",
|
| 6 |
+
"auto_map": {
|
| 7 |
+
"AutoConfig": "configuration_pebble.PebbleConfig",
|
| 8 |
+
"AutoModelForCausalLM": "modeling_pebble.PebbleForCausalLM"
|
| 9 |
+
},
|
| 10 |
"vocab_size": 2048,
|
| 11 |
+
"hidden_size": 608,
|
| 12 |
+
"intermediate_size": 2432,
|
| 13 |
+
"num_hidden_layers": 8,
|
| 14 |
+
"num_attention_heads": 8,
|
| 15 |
+
"block_pattern": "mmma|mmma",
|
| 16 |
+
"hybrid_ratio": "3:1 mamba2:attention",
|
| 17 |
+
"max_position_embeddings": 2048,
|
| 18 |
+
"rms_norm_eps": 1e-06,
|
| 19 |
+
"tie_word_embeddings": true,
|
| 20 |
+
"mamba2": {
|
| 21 |
+
"d_state": 128,
|
| 22 |
+
"d_conv": 4,
|
| 23 |
+
"expand": 2,
|
| 24 |
+
"headdim": 64,
|
| 25 |
+
"use_mem_eff_path": true
|
| 26 |
+
},
|
| 27 |
+
"attention": {
|
| 28 |
+
"rope_theta": 10000.0,
|
| 29 |
+
"is_causal": true
|
| 30 |
+
},
|
| 31 |
+
"torch_dtype": "float32"
|
| 32 |
}
|