Text Generation
Transformers
Safetensors
English
llama
causal-lm
instruct
chat
sft
tinybrain
100m
small-language-model
tiny-llm
english
text-generation-inference
Instructions to use exnivo/tinybrain-100m-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use exnivo/tinybrain-100m-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="exnivo/tinybrain-100m-instruct")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("exnivo/tinybrain-100m-instruct") model = AutoModelForCausalLM.from_pretrained("exnivo/tinybrain-100m-instruct", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use exnivo/tinybrain-100m-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "exnivo/tinybrain-100m-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "exnivo/tinybrain-100m-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/exnivo/tinybrain-100m-instruct
- SGLang
How to use exnivo/tinybrain-100m-instruct 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 "exnivo/tinybrain-100m-instruct" \ --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": "exnivo/tinybrain-100m-instruct", "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 "exnivo/tinybrain-100m-instruct" \ --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": "exnivo/tinybrain-100m-instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use exnivo/tinybrain-100m-instruct with Docker Model Runner:
docker model run hf.co/exnivo/tinybrain-100m-instruct
Upload TinyBrain-100M Instruct model
Browse files- README.md +38 -0
- config.json +32 -0
- generation_config.json +10 -0
- model.safetensors +3 -0
- tinybrain_sft_meta.json +10 -0
- tokenizer.json +0 -0
- tokenizer_config.json +22 -0
README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
base_model: exnivo/tinybrain-100m-base
|
| 6 |
+
datasets:
|
| 7 |
+
- exnivo/tinybrain-instruct
|
| 8 |
+
tags:
|
| 9 |
+
- text-generation
|
| 10 |
+
- causal-lm
|
| 11 |
+
- instruct
|
| 12 |
+
- chat
|
| 13 |
+
- tinybrain
|
| 14 |
+
- sft
|
| 15 |
---
|
| 16 |
+
|
| 17 |
+
# TinyBrain-100M Instruct
|
| 18 |
+
|
| 19 |
+
TinyBrain-100M Instruct is a small chat/instruct model fine-tuned from `exnivo/tinybrain-100m-base` on `exnivo/tinybrain-instruct`.
|
| 20 |
+
|
| 21 |
+
## Model details
|
| 22 |
+
|
| 23 |
+
- Parameters: ~103M
|
| 24 |
+
- Architecture: LLaMA-style causal transformer
|
| 25 |
+
- Tokenizer: custom TinyBrain byte-level BPE
|
| 26 |
+
- Vocab size: 24,000
|
| 27 |
+
- Base model: `exnivo/tinybrain-100m-base`
|
| 28 |
+
- SFT dataset: `exnivo/tinybrain-instruct`
|
| 29 |
+
|
| 30 |
+
## Prompt format
|
| 31 |
+
|
| 32 |
+
```text
|
| 33 |
+
<|bos|><|user|>
|
| 34 |
+
Your message here
|
| 35 |
+
<|end|>
|
| 36 |
+
<|assistant|>
|
| 37 |
+
````
|
| 38 |
+
|
| 39 |
+
## Limitations
|
| 40 |
+
|
| 41 |
+
This is a very small model. It can hallucinate, make factual mistakes, fail at math, and give unreliable answers. Do not use it for medical, legal, financial, or safety-critical decisions.
|
config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"LlamaForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": 2,
|
| 10 |
+
"head_dim": 64,
|
| 11 |
+
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 768,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 2048,
|
| 15 |
+
"max_position_embeddings": 2048,
|
| 16 |
+
"mlp_bias": false,
|
| 17 |
+
"model_type": "llama",
|
| 18 |
+
"num_attention_heads": 12,
|
| 19 |
+
"num_hidden_layers": 12,
|
| 20 |
+
"num_key_value_heads": 12,
|
| 21 |
+
"pad_token_id": 0,
|
| 22 |
+
"pretraining_tp": 1,
|
| 23 |
+
"rms_norm_eps": 1e-05,
|
| 24 |
+
"rope_parameters": {
|
| 25 |
+
"rope_theta": 10000.0,
|
| 26 |
+
"rope_type": "default"
|
| 27 |
+
},
|
| 28 |
+
"tie_word_embeddings": true,
|
| 29 |
+
"transformers_version": "5.12.1",
|
| 30 |
+
"use_cache": false,
|
| 31 |
+
"vocab_size": 24000
|
| 32 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": 2,
|
| 5 |
+
"output_attentions": false,
|
| 6 |
+
"output_hidden_states": false,
|
| 7 |
+
"pad_token_id": 0,
|
| 8 |
+
"transformers_version": "5.12.1",
|
| 9 |
+
"use_cache": false
|
| 10 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f9e0f3883b4b5c76643f2a3b67a86d049bf27c98e80b73a2bb9557a4e598217
|
| 3 |
+
size 206783968
|
tinybrain_sft_meta.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"step": 522,
|
| 3 |
+
"val_loss": 2.2578155994415283,
|
| 4 |
+
"base_model": "exnivo/tinybrain-100m-base",
|
| 5 |
+
"dataset": "exnivo/tinybrain-instruct",
|
| 6 |
+
"batch_size": 100,
|
| 7 |
+
"block_size": 1024,
|
| 8 |
+
"epochs": 3,
|
| 9 |
+
"lr": 7e-05
|
| 10 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<|bos|>",
|
| 4 |
+
"clean_up_tokenization_spaces": false,
|
| 5 |
+
"eos_token": "<|eos|>",
|
| 6 |
+
"extra_special_tokens": [
|
| 7 |
+
"<|user|>",
|
| 8 |
+
"<|assistant|>",
|
| 9 |
+
"<|system|>",
|
| 10 |
+
"<|end|>",
|
| 11 |
+
"<|tool|>",
|
| 12 |
+
"<|tool_call|>",
|
| 13 |
+
"<|tool_result|>"
|
| 14 |
+
],
|
| 15 |
+
"is_local": false,
|
| 16 |
+
"local_files_only": false,
|
| 17 |
+
"model_max_length": 2048,
|
| 18 |
+
"pad_token": "<|pad|>",
|
| 19 |
+
"padding_side": "right",
|
| 20 |
+
"tokenizer_class": "TokenizersBackend",
|
| 21 |
+
"truncation_side": "right"
|
| 22 |
+
}
|