Text Generation
Transformers
Safetensors
English
qwen3-next
gated-deltanet
hybrid-attention
mixture-of-experts
Mixture of Experts
tinystories
tiny-model
validation
debug-model
Instructions to use shibatch/tinyqwen3next3m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shibatch/tinyqwen3next3m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shibatch/tinyqwen3next3m")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("shibatch/tinyqwen3next3m", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use shibatch/tinyqwen3next3m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shibatch/tinyqwen3next3m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shibatch/tinyqwen3next3m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/shibatch/tinyqwen3next3m
- SGLang
How to use shibatch/tinyqwen3next3m 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 "shibatch/tinyqwen3next3m" \ --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": "shibatch/tinyqwen3next3m", "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 "shibatch/tinyqwen3next3m" \ --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": "shibatch/tinyqwen3next3m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use shibatch/tinyqwen3next3m with Docker Model Runner:
docker model run hf.co/shibatch/tinyqwen3next3m
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -291,6 +291,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_dir)
|
|
| 291 |
model = AutoModelForCausalLM.from_pretrained(
|
| 292 |
model_dir,
|
| 293 |
dtype=torch.float32,
|
|
|
|
| 294 |
).to(device)
|
| 295 |
model.eval()
|
| 296 |
|
|
@@ -339,6 +340,21 @@ The optional `flash-linear-attention` and `causal-conv1d` packages are not
|
|
| 339 |
required. Without them, Transformers uses its PyTorch Gated DeltaNet fallback,
|
| 340 |
which is the path used to train and validate this checkpoint.
|
| 341 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
## Intended uses
|
| 343 |
|
| 344 |
This model is intended for:
|
|
|
|
| 291 |
model = AutoModelForCausalLM.from_pretrained(
|
| 292 |
model_dir,
|
| 293 |
dtype=torch.float32,
|
| 294 |
+
experts_implementation="batched_mm",
|
| 295 |
).to(device)
|
| 296 |
model.eval()
|
| 297 |
|
|
|
|
| 340 |
required. Without them, Transformers uses its PyTorch Gated DeltaNet fallback,
|
| 341 |
which is the path used to train and validate this checkpoint.
|
| 342 |
|
| 343 |
+
The examples explicitly select `experts_implementation="batched_mm"`. The
|
| 344 |
+
model's routed experts have an intermediate width of 54, while the default
|
| 345 |
+
PyTorch `grouped_mm` CUDA path in some recent Torch/Transformers combinations
|
| 346 |
+
requires expert matrix strides to be multiples of 16 bytes. Without the
|
| 347 |
+
explicit compatible implementation, loading succeeds but the first forward
|
| 348 |
+
pass can fail with:
|
| 349 |
+
|
| 350 |
+
```text
|
| 351 |
+
RuntimeError: strides should be multiple of 16 bytes
|
| 352 |
+
```
|
| 353 |
+
|
| 354 |
+
`batched_mm` evaluates the same expert weights without that grouped-kernel
|
| 355 |
+
layout restriction. `experts_implementation="eager"` is also a compatible,
|
| 356 |
+
slower fallback.
|
| 357 |
+
|
| 358 |
## Intended uses
|
| 359 |
|
| 360 |
This model is intended for:
|