Text Generation
Transformers
Safetensors
English
llama
supra
supra-1.5
50m
base
continued-pretraining
long-context
5k-context
Supra
Supra-50M
chatml
conversational
text-generation-inference
Instructions to use spitfire4794/Supra-1.5-50M-Base-exp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use spitfire4794/Supra-1.5-50M-Base-exp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="spitfire4794/Supra-1.5-50M-Base-exp") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("spitfire4794/Supra-1.5-50M-Base-exp") model = AutoModelForCausalLM.from_pretrained("spitfire4794/Supra-1.5-50M-Base-exp") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use spitfire4794/Supra-1.5-50M-Base-exp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "spitfire4794/Supra-1.5-50M-Base-exp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "spitfire4794/Supra-1.5-50M-Base-exp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/spitfire4794/Supra-1.5-50M-Base-exp
- SGLang
How to use spitfire4794/Supra-1.5-50M-Base-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 "spitfire4794/Supra-1.5-50M-Base-exp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "spitfire4794/Supra-1.5-50M-Base-exp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "spitfire4794/Supra-1.5-50M-Base-exp" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "spitfire4794/Supra-1.5-50M-Base-exp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use spitfire4794/Supra-1.5-50M-Base-exp with Docker Model Runner:
docker model run hf.co/spitfire4794/Supra-1.5-50M-Base-exp
Update README.md
Browse files
README.md
CHANGED
|
@@ -15,9 +15,10 @@ tags:
|
|
| 15 |
- 5k-context
|
| 16 |
- Supra
|
| 17 |
- Supra-50M
|
|
|
|
| 18 |
---
|
| 19 |
|
| 20 |
-
<h1 align="center">Supra1.5-50M Base</h1>
|
| 21 |
|
| 22 |
<p align="center">
|
| 23 |
Continued Pretraining • 50M Parameters • 5K Context
|
|
@@ -25,33 +26,39 @@ tags:
|
|
| 25 |
|
| 26 |

|
| 27 |
|
| 28 |
-
Supra-1.5-50M-Base-exp is a continued-pretrained 50M parameter Llama-style base
|
| 29 |
-
model derived from `SupraLabs/Supra-50M-Base`. The target update expands the
|
| 30 |
-
usable context window from 1,024 tokens to 5,120 tokens using RoPE scaling and
|
| 31 |
-
full-weight continued pretraining.
|
| 32 |
|
|
|
|
| 33 |
|
| 34 |
-
|
| 35 |
-
## Architecture
|
| 36 |
-
|
| 37 |
-
The model keeps the original Supra-50M architecture and tokenizer:
|
| 38 |
|
| 39 |
| Specification | Value |
|
| 40 |
|--------------|--------|
|
| 41 |
| Architecture | `LlamaForCausalLM` |
|
| 42 |
| Parameters | ~50M |
|
| 43 |
-
| Vocabulary Size | 32,
|
| 44 |
| Hidden Size | 512 |
|
| 45 |
| Layers | 12 |
|
| 46 |
| Attention Heads | 8 |
|
| 47 |
| KV Heads | 4 |
|
| 48 |
| Context Length | 5,120 tokens |
|
| 49 |
-
| Tokenizer |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
## Continued Pretraining Objective
|
| 52 |
|
| 53 |
-
This is
|
| 54 |
-
standard causal language-modeling loss:
|
| 55 |
|
| 56 |
- `labels = input_ids`
|
| 57 |
- all non-pad tokens are trained
|
|
@@ -61,7 +68,7 @@ standard causal language-modeling loss:
|
|
| 61 |
|
| 62 |
## Data Mix
|
| 63 |
|
| 64 |
-
The
|
| 65 |
|
| 66 |
- 3,000,000,062 CPT tokens
|
| 67 |
- 30% Tool Calling
|
|
@@ -69,6 +76,14 @@ The current local training mix prepared for this run is:
|
|
| 69 |
- 25% Factual Text (articles, essays, blogs)
|
| 70 |
- 15% Math & Logic Questions
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|
|
|
|
| 15 |
- 5k-context
|
| 16 |
- Supra
|
| 17 |
- Supra-50M
|
| 18 |
+
- chatml
|
| 19 |
---
|
| 20 |
|
| 21 |
+
<h1 align="center">Supra1.5-50M Base (ChatML)</h1>
|
| 22 |
|
| 23 |
<p align="center">
|
| 24 |
Continued Pretraining • 50M Parameters • 5K Context
|
|
|
|
| 26 |
|
| 27 |

|
| 28 |
|
| 29 |
+
Supra-1.5-50M-Base-exp is a continued-pretrained 50M parameter Llama-style base model derived from `SupraLabs/Supra-50M-Base`. The context window has been expanded from 1,024 to 5,120 tokens using RoPE scaling and full-weight continued pretraining.
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
This specific repository has been modified to natively support ChatML. The tokenizer and embedding layers have been updated to include `<|im_start|>` and `<|im_end|>` as single special tokens.
|
| 32 |
|
| 33 |
+
## Architecture & Updates
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
| Specification | Value |
|
| 36 |
|--------------|--------|
|
| 37 |
| Architecture | `LlamaForCausalLM` |
|
| 38 |
| Parameters | ~50M |
|
| 39 |
+
| Vocabulary Size | 32,002 (Expanded for ChatML) |
|
| 40 |
| Hidden Size | 512 |
|
| 41 |
| Layers | 12 |
|
| 42 |
| Attention Heads | 8 |
|
| 43 |
| KV Heads | 4 |
|
| 44 |
| Context Length | 5,120 tokens |
|
| 45 |
+
| Tokenizer | BPE tokenizer (ChatML Jinja template applied) |
|
| 46 |
+
| Native EOS Token | `<|im_end|>` |
|
| 47 |
+
|
| 48 |
+
## Vocabulary Expansion & Initialization
|
| 49 |
+
|
| 50 |
+
The model's 3B token CPT corpus included raw ChatML text. As a result, the base model originally learned the tags `<|im_start|>` and `<|im_end|>` as sequences of 7 separate subwords.
|
| 51 |
+
|
| 52 |
+
To convert these tags into single tokens without destroying the learned pre-trained representations, we used subword-mean initialization:
|
| 53 |
+
1. Extracted the attention embeddings for the original 7-token sequences.
|
| 54 |
+
2. Averaged the weights for each sequence.
|
| 55 |
+
3. Assigned these mean weights to the new single-token IDs.
|
| 56 |
+
|
| 57 |
+
This ensures stable loss at the start of fine-tuning and allows inference frameworks to natively stop generation when `<|im_end|>` is predicted.
|
| 58 |
|
| 59 |
## Continued Pretraining Objective
|
| 60 |
|
| 61 |
+
This is a base model, not an instruct model. Training used packed raw text with standard causal language-modeling loss:
|
|
|
|
| 62 |
|
| 63 |
- `labels = input_ids`
|
| 64 |
- all non-pad tokens are trained
|
|
|
|
| 68 |
|
| 69 |
## Data Mix
|
| 70 |
|
| 71 |
+
The training mix prepared for the CPT run was:
|
| 72 |
|
| 73 |
- 3,000,000,062 CPT tokens
|
| 74 |
- 30% Tool Calling
|
|
|
|
| 76 |
- 25% Factual Text (articles, essays, blogs)
|
| 77 |
- 15% Math & Logic Questions
|
| 78 |
|
| 79 |
+
## Fine-Tuning Guide
|
| 80 |
+
|
| 81 |
+
This model is intended for Supervised Fine-Tuning (SFT) and Reinforcement Learning (RL), including reasoning-style (R1) alignments.
|
| 82 |
+
|
| 83 |
+
You can use standard Hugging Face tools and call `tokenizer.apply_chat_template()` directly on your datasets.
|
| 84 |
+
|
| 85 |
+
**LoRA Configuration Note:**
|
| 86 |
+
Because the vocabulary size was expanded from 32,000 to 32,002, you must train the embedding layers during fine-tuning so the model can update the new ChatML tokens. Add the following to your PEFT/LoRA configuration:
|
| 87 |
|
| 88 |
+
```python
|
| 89 |
+
modules_to_save=["embed_tokens", "lm_head"]
|