Text Generation
Transformers
Safetensors
tinyqwen3_novelty
qwen3
causal-lm
tiny-language-model
novelty-gated-attention
trust-remote-code
custom_code
Instructions to use User01110/tinyLM-8M-exp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use User01110/tinyLM-8M-exp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="User01110/tinyLM-8M-exp", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("User01110/tinyLM-8M-exp", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use User01110/tinyLM-8M-exp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "User01110/tinyLM-8M-exp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "User01110/tinyLM-8M-exp", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/User01110/tinyLM-8M-exp
- SGLang
How to use User01110/tinyLM-8M-exp 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 "User01110/tinyLM-8M-exp" \ --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": "User01110/tinyLM-8M-exp", "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 "User01110/tinyLM-8M-exp" \ --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": "User01110/tinyLM-8M-exp", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use User01110/tinyLM-8M-exp with Docker Model Runner:
docker model run hf.co/User01110/tinyLM-8M-exp
Use custom config type to prevent Qwen3 fallback
Browse files- README.md +2 -2
- config.json +2 -2
- modeling_tinyqwen3_novelty.py +3 -4
README.md
CHANGED
|
@@ -17,7 +17,7 @@ Tiny 8M-class Qwen3-config causal LM with math-only novelty-gated GQA.
|
|
| 17 |
|
| 18 |
| Item | Value |
|
| 19 |
| --- | ---: |
|
| 20 |
-
| Config type | `
|
| 21 |
| Parameters | 8.132M |
|
| 22 |
| Layers | 8 |
|
| 23 |
| Hidden size | 256 |
|
|
@@ -119,4 +119,4 @@ with torch.no_grad():
|
|
| 119 |
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
| 120 |
```
|
| 121 |
|
| 122 |
-
This repo uses a self-contained remote `
|
|
|
|
| 17 |
|
| 18 |
| Item | Value |
|
| 19 |
| --- | ---: |
|
| 20 |
+
| Config type | `tinyqwen3_novelty` |
|
| 21 |
| Parameters | 8.132M |
|
| 22 |
| Layers | 8 |
|
| 23 |
| Hidden size | 256 |
|
|
|
|
| 119 |
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
| 120 |
```
|
| 121 |
|
| 122 |
+
This repo uses a self-contained remote `TinyQwen3NoveltyConfig` plus model code for a Qwen3-style dense decoder with a math-only novelty-gated attention block.
|
config.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
{
|
| 2 |
-
"model_type": "
|
| 3 |
"architectures": [
|
| 4 |
"TinyQwen3NoveltyForCausalLM"
|
| 5 |
],
|
| 6 |
"auto_map": {
|
| 7 |
-
"AutoConfig": "modeling_tinyqwen3_novelty.
|
| 8 |
"AutoModelForCausalLM": "modeling_tinyqwen3_novelty.TinyQwen3NoveltyForCausalLM"
|
| 9 |
},
|
| 10 |
"vocab_size": 4098,
|
|
|
|
| 1 |
{
|
| 2 |
+
"model_type": "tinyqwen3_novelty",
|
| 3 |
"architectures": [
|
| 4 |
"TinyQwen3NoveltyForCausalLM"
|
| 5 |
],
|
| 6 |
"auto_map": {
|
| 7 |
+
"AutoConfig": "modeling_tinyqwen3_novelty.TinyQwen3NoveltyConfig",
|
| 8 |
"AutoModelForCausalLM": "modeling_tinyqwen3_novelty.TinyQwen3NoveltyForCausalLM"
|
| 9 |
},
|
| 10 |
"vocab_size": 4098,
|
modeling_tinyqwen3_novelty.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
|
| 2 |
import torch
|
| 3 |
import torch.nn as nn
|
| 4 |
import torch.nn.functional as F
|
|
@@ -7,8 +6,8 @@ from transformers.generation import GenerationMixin
|
|
| 7 |
from transformers.modeling_outputs import CausalLMOutput
|
| 8 |
|
| 9 |
|
| 10 |
-
class
|
| 11 |
-
model_type = "
|
| 12 |
|
| 13 |
def __init__(
|
| 14 |
self,
|
|
@@ -174,7 +173,7 @@ class TinyQwen3NoveltyBlock(nn.Module):
|
|
| 174 |
|
| 175 |
|
| 176 |
class TinyQwen3NoveltyForCausalLM(PreTrainedModel, GenerationMixin):
|
| 177 |
-
config_class =
|
| 178 |
base_model_prefix = ""
|
| 179 |
_no_split_modules = ["TinyQwen3NoveltyBlock"]
|
| 180 |
_tied_weights_keys = {}
|
|
|
|
|
|
|
| 1 |
import torch
|
| 2 |
import torch.nn as nn
|
| 3 |
import torch.nn.functional as F
|
|
|
|
| 6 |
from transformers.modeling_outputs import CausalLMOutput
|
| 7 |
|
| 8 |
|
| 9 |
+
class TinyQwen3NoveltyConfig(PretrainedConfig):
|
| 10 |
+
model_type = "tinyqwen3_novelty"
|
| 11 |
|
| 12 |
def __init__(
|
| 13 |
self,
|
|
|
|
| 173 |
|
| 174 |
|
| 175 |
class TinyQwen3NoveltyForCausalLM(PreTrainedModel, GenerationMixin):
|
| 176 |
+
config_class = TinyQwen3NoveltyConfig
|
| 177 |
base_model_prefix = ""
|
| 178 |
_no_split_modules = ["TinyQwen3NoveltyBlock"]
|
| 179 |
_tied_weights_keys = {}
|