Text Generation
Transformers
Safetensors
English
gpt2
open-reason
causal-lm
cpu
text-generation-inference
Instructions to use theworker02/open-reason-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use theworker02/open-reason-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="theworker02/open-reason-small")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("theworker02/open-reason-small") model = AutoModelForCausalLM.from_pretrained("theworker02/open-reason-small", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use theworker02/open-reason-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "theworker02/open-reason-small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "theworker02/open-reason-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/theworker02/open-reason-small
- SGLang
How to use theworker02/open-reason-small 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 "theworker02/open-reason-small" \ --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": "theworker02/open-reason-small", "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 "theworker02/open-reason-small" \ --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": "theworker02/open-reason-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use theworker02/open-reason-small with Docker Model Runner:
docker model run hf.co/theworker02/open-reason-small
Upload Open Reason small CPU causal LM (not 1B)
Browse files- README.md +34 -0
- config.json +35 -0
- generation_config.json +10 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +9 -0
- train_metrics.json +27 -0
README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
library_name: transformers
|
| 6 |
+
tags:
|
| 7 |
+
- open-reason
|
| 8 |
+
- causal-lm
|
| 9 |
+
- cpu
|
| 10 |
+
datasets:
|
| 11 |
+
- theworker02/open-reason
|
| 12 |
+
base_model: gpt2-scratch
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Open Reason small (CPU)
|
| 16 |
+
|
| 17 |
+
This is a **small** GPT-2-style causal LM trained from scratch on the
|
| 18 |
+
Open Reason SFT split. It is **not** a 1B model and is **not**
|
| 19 |
+
`theworker02/open-reason-1b`.
|
| 20 |
+
|
| 21 |
+
- Parameters (approx): 1334016
|
| 22 |
+
- Steps: 200
|
| 23 |
+
- Backend: cpu-host
|
| 24 |
+
- CUDA used: False
|
| 25 |
+
- Rows: 2348
|
| 26 |
+
- Final loss: 6.095415115356445
|
| 27 |
+
|
| 28 |
+
Hardware: CPU (Docker when available). AMD GPU training is not used.
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 32 |
+
tok = AutoTokenizer.from_pretrained("theworker02/open-reason-small")
|
| 33 |
+
model = AutoModelForCausalLM.from_pretrained("theworker02/open-reason-small")
|
| 34 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_function": "gelu_new",
|
| 3 |
+
"add_cross_attention": false,
|
| 4 |
+
"architectures": [
|
| 5 |
+
"GPT2LMHeadModel"
|
| 6 |
+
],
|
| 7 |
+
"attn_pdrop": 0.1,
|
| 8 |
+
"bos_token_id": 2,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"embd_pdrop": 0.1,
|
| 11 |
+
"eos_token_id": 3,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"layer_norm_epsilon": 1e-05,
|
| 14 |
+
"model_type": "gpt2",
|
| 15 |
+
"n_ctx": 128,
|
| 16 |
+
"n_embd": 128,
|
| 17 |
+
"n_head": 4,
|
| 18 |
+
"n_inner": null,
|
| 19 |
+
"n_layer": 4,
|
| 20 |
+
"n_positions": 128,
|
| 21 |
+
"pad_token_id": 1,
|
| 22 |
+
"reorder_and_upcast_attn": false,
|
| 23 |
+
"resid_pdrop": 0.1,
|
| 24 |
+
"scale_attn_by_inverse_layer_idx": false,
|
| 25 |
+
"scale_attn_weights": true,
|
| 26 |
+
"summary_activation": null,
|
| 27 |
+
"summary_first_dropout": 0.1,
|
| 28 |
+
"summary_proj_to_labels": true,
|
| 29 |
+
"summary_type": "cls_index",
|
| 30 |
+
"summary_use_proj": true,
|
| 31 |
+
"tie_word_embeddings": true,
|
| 32 |
+
"transformers_version": "5.10.2",
|
| 33 |
+
"use_cache": true,
|
| 34 |
+
"vocab_size": 4096
|
| 35 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 2,
|
| 4 |
+
"eos_token_id": 3,
|
| 5 |
+
"output_attentions": false,
|
| 6 |
+
"output_hidden_states": false,
|
| 7 |
+
"pad_token_id": 1,
|
| 8 |
+
"transformers_version": "5.10.2",
|
| 9 |
+
"use_cache": true
|
| 10 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0db31aae3e0d0b741acbf8e624c054c36d7e053f7bc05f98ba0404732e4198a6
|
| 3 |
+
size 5341104
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "[BOS]",
|
| 4 |
+
"eos_token": "[EOS]",
|
| 5 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 6 |
+
"pad_token": "[PAD]",
|
| 7 |
+
"tokenizer_class": "TokenizersBackend",
|
| 8 |
+
"unk_token": "[UNK]"
|
| 9 |
+
}
|
train_metrics.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"smoke": false,
|
| 3 |
+
"cuda": false,
|
| 4 |
+
"backend": "cpu-host",
|
| 5 |
+
"architecture": "gpt2-scratch",
|
| 6 |
+
"param_count": 1334016,
|
| 7 |
+
"n_layer": 4,
|
| 8 |
+
"n_embd": 128,
|
| 9 |
+
"n_head": 4,
|
| 10 |
+
"steps": 200,
|
| 11 |
+
"rows": 2348,
|
| 12 |
+
"final_loss": 6.095415115356445,
|
| 13 |
+
"losses_tail": [
|
| 14 |
+
5.3571391105651855,
|
| 15 |
+
5.712825298309326,
|
| 16 |
+
5.500826835632324,
|
| 17 |
+
5.698274612426758,
|
| 18 |
+
5.465966701507568,
|
| 19 |
+
5.777740001678467,
|
| 20 |
+
5.92188024520874,
|
| 21 |
+
5.687778472900391,
|
| 22 |
+
5.9522929191589355,
|
| 23 |
+
6.095415115356445
|
| 24 |
+
],
|
| 25 |
+
"hub_id_if_uploaded": "theworker02/open-reason-small",
|
| 26 |
+
"note": "Small CPU causal LM. Not open-reason-1b. Not AMD GPU."
|
| 27 |
+
}
|