Text Generation
Transformers
Safetensors
English
llama
small
cpu
supra
v2
tiny
mini
open
open-source
text-generation-inference
Instructions to use SupraLabs/Supra-Mini-v2-0.1M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SupraLabs/Supra-Mini-v2-0.1M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SupraLabs/Supra-Mini-v2-0.1M")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SupraLabs/Supra-Mini-v2-0.1M") model = AutoModelForCausalLM.from_pretrained("SupraLabs/Supra-Mini-v2-0.1M") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use SupraLabs/Supra-Mini-v2-0.1M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SupraLabs/Supra-Mini-v2-0.1M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SupraLabs/Supra-Mini-v2-0.1M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SupraLabs/Supra-Mini-v2-0.1M
- SGLang
How to use SupraLabs/Supra-Mini-v2-0.1M 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 "SupraLabs/Supra-Mini-v2-0.1M" \ --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": "SupraLabs/Supra-Mini-v2-0.1M", "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 "SupraLabs/Supra-Mini-v2-0.1M" \ --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": "SupraLabs/Supra-Mini-v2-0.1M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SupraLabs/Supra-Mini-v2-0.1M with Docker Model Runner:
docker model run hf.co/SupraLabs/Supra-Mini-v2-0.1M
File size: 4,493 Bytes
95b158c 5b0c092 95b158c 6511fd8 95b158c 6511fd8 95b158c be26fc5 c2a6744 95b158c be26fc5 95b158c be26fc5 95b158c be26fc5 95b158c 6511fd8 95b158c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | ---
license: apache-2.0
datasets:
- HuggingFaceFW/fineweb-edu
language:
- en
pipeline_tag: text-generation
library_name: transformers
tags:
- small
- cpu
- supra
- v2
- tiny
- mini
- open
- open-source
new_version: SupraLabs/Supra-Mini-v4-2M
---
# 🦅 Supra Mini v2 0.1M
Supra Mini **v2** 0.1M is a very, and we mean very small base model trained on 700 million tokens of Fineweb-Edu for 3 epochs as the **second version** of our Supra Mini series.
## Model Config
- Parameters: 167,760 (0.1M)
- Architecture: Llama
- Vocab size with custom BPE tokenizer: 2048
- Hidden Size: 48
- Intermediate Size: 96
- Hidden Layers: 3
- Attention Heads: 4
- Max Position Embeddings: 256
- Learning rate: 6e-4
- Weight Decay: 0.01
## Final Loss
This model reached a final train loss of **4.413**.
## Benchmarks
All benchmarks were executed using `lm-eval`.
| Task | Value | Random level |
| :------------ | :----------: | -----------: |
| Arc_Easy | 0.2677 | 0.25 (25%) |
| Wikitext | 7.7940 | - |
| BLiMP | 0.5354 | 0.5 (50%) |
## Examples
**Prompt:** "Artificial intelligence is "<br>
**Output:**: *"Artificial intelligence is irreciously, and the diet of a battery.
These are also known as the following:
\- Foods, in the most commonly used to be taken by the priority of the South African American Modela, which was nothing for the first time. The federal government has been a wall of the world’s two moisture and the came on the national range of the Great Department of Amazonia, and the Politary Society of the Carli. This is that the Letters were the first third of the Building S"*
<br><br>
**Prompt:** "The main concept of physics is "<br>
**Output:**: *"The main concept of physics is utilized in the most commonly used to be achieved.
Chotos, an efficient for a dietary pathogene, and that are also known as a source of the molecularly. The failure wastered in the national categories of the California, and the Modela’s brought by the Florida. In the world's this time, it is not only on the sense of the first-metrial gardens, but they can be living in the task of the Political School of History (professed"*
<br><br>
**Prompt:** "Once upon a time, "<br>
**Output:**: *"Once upon a time, utilizing the fire.
The Samboard is that the lot of the bill.
After the day to be a widely money and in the world’s a harmful force.
Despite the size of the Bradese, and his owner, and he was noted by the Department of Management, and the Lord of Petersonia and the Council, which had been a destroyed on the tree, but the giving a came from the Hiska. The Great Marius and Jewish Amazon's Rich"*
## Usage
To use our model, just run this code using HF Transformers to execute the model:
```python3
from transformers import pipeline
import torch
print("[*] Loading Supra Mini v2 0.1M model from Hugging Face Hub...")
pipe = pipeline(
"text-generation",
model="SupraLabs/Supra-Mini-v2-0.1M",
device_map="auto",
torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32
)
def generate_text(prompt, max_length=150):
result = pipe(
prompt,
max_new_tokens=max_length,
do_sample=True,
temperature=0.5,
top_k=25,
top_p=0.9,
repetition_penalty=1.2,
pad_token_id=pipe.tokenizer.pad_token_id,
eos_token_id=pipe.tokenizer.eos_token_id
)
return result[0]['generated_text']
test_prompt = "The importance of education is"
print(f"\nPrompt: {test_prompt}")
print("-" * 30)
print("\nOutput:\n" + generate_text(test_prompt))
```
## Use cases
1. Educational research
2. deployment or testing/fine-tuning on edge environments
3. Or more simply, for fun
## Limitations
1. Cannot reason, chat, or code
2. Incoherent more often than not
3. Mostly unfactual
## Training guide
We trained Supra Mini v2 0.1M on a single T4 GPU in ~2 hours for 3 epochs.<br>
The full training code can be found in this repo as `run.sh` (easily run the complete pipeline), `train_tokenizer.py` (train costum BPE tokenizer with vocab size of 2048), `train.py` (train the model) and `inference.py` (test the model).<br>
The model was trained on the first 700 million tokens of Sample-10BT from Fineweb-Edu using streaming tokenization.
## Final thoughts
As this is the second version of the Supra Mini series, we are very proud to release it today!<br>
*But:* stay tuned for more models and follow us to support our open-source work! 😊 |