Text Generation
Transformers
Safetensors
English
gpt2
open-reason
causal-lm
cpu
text-generation-inference
Instructions to use theworker02/open-reason-medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use theworker02/open-reason-medium with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="theworker02/open-reason-medium")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("theworker02/open-reason-medium") model = AutoModelForCausalLM.from_pretrained("theworker02/open-reason-medium", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use theworker02/open-reason-medium with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "theworker02/open-reason-medium" # 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-medium", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/theworker02/open-reason-medium
- SGLang
How to use theworker02/open-reason-medium 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-medium" \ --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-medium", "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-medium" \ --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-medium", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use theworker02/open-reason-medium with Docker Model Runner:
docker model run hf.co/theworker02/open-reason-medium
Upload Open Reason CPU causal LM theworker02/open-reason-medium (not 1B)
Browse files- README.md +35 -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 +32 -0
README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 open-reason-medium (CPU)
|
| 16 |
+
|
| 17 |
+
This is a **medium** GPT-2-style causal LM trained from scratch on the Open Reason SFT split. It is larger than `theworker02/open-reason-small` and is **not** a 1B model and is **not** `theworker02/open-reason-1b`.
|
| 18 |
+
|
| 19 |
+
- Parameters: 13867008
|
| 20 |
+
- Architecture: n_layer=6 n_embd=384 n_head=6
|
| 21 |
+
- Steps: 180
|
| 22 |
+
- Backend: cpu-host
|
| 23 |
+
- CUDA used: False
|
| 24 |
+
- Hardware: CPU (Docker when available). AMD GPU is not used.
|
| 25 |
+
- Dataset: theworker02/open-reason pipeline 1.4.0
|
| 26 |
+
- SFT rows: 3175
|
| 27 |
+
- Final loss: 4.416327476501465
|
| 28 |
+
|
| 29 |
+
No Reddit sources. Project license Apache-2.0.
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 33 |
+
tok = AutoTokenizer.from_pretrained("theworker02/open-reason-medium")
|
| 34 |
+
model = AutoModelForCausalLM.from_pretrained("theworker02/open-reason-medium")
|
| 35 |
+
```
|
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": 192,
|
| 16 |
+
"n_embd": 384,
|
| 17 |
+
"n_head": 6,
|
| 18 |
+
"n_inner": null,
|
| 19 |
+
"n_layer": 6,
|
| 20 |
+
"n_positions": 192,
|
| 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": 8192
|
| 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:5afde2cd48c81a7592108b7bd10d592211d4e54340c4b6fdb45a540361992af8
|
| 3 |
+
size 55475568
|
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,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"smoke": false,
|
| 3 |
+
"cuda": false,
|
| 4 |
+
"backend": "cpu-host",
|
| 5 |
+
"architecture": "gpt2-scratch",
|
| 6 |
+
"param_count": 13867008,
|
| 7 |
+
"n_layer": 6,
|
| 8 |
+
"n_embd": 384,
|
| 9 |
+
"n_head": 6,
|
| 10 |
+
"vocab_size": 8192,
|
| 11 |
+
"max_seq_len": 192,
|
| 12 |
+
"steps": 180,
|
| 13 |
+
"rows": 3175,
|
| 14 |
+
"dataset_version": "1.4.0",
|
| 15 |
+
"final_loss": 4.416327476501465,
|
| 16 |
+
"losses_tail": [
|
| 17 |
+
5.1331095695495605,
|
| 18 |
+
5.0547776222229,
|
| 19 |
+
4.5566725730896,
|
| 20 |
+
5.206869602203369,
|
| 21 |
+
6.316340923309326,
|
| 22 |
+
5.287867069244385,
|
| 23 |
+
5.436374664306641,
|
| 24 |
+
5.335423946380615,
|
| 25 |
+
5.663321495056152,
|
| 26 |
+
4.416327476501465
|
| 27 |
+
],
|
| 28 |
+
"hub_id_if_uploaded": "theworker02/open-reason-medium",
|
| 29 |
+
"card_title": "Open Reason open-reason-medium (CPU)",
|
| 30 |
+
"size_note": "This is a **medium** GPT-2-style causal LM trained from scratch on the Open Reason SFT split. It is larger than `theworker02/open-reason-small` and is **not** a 1B model and is **not** `theworker02/open-reason-1b`.",
|
| 31 |
+
"note": "CPU causal LM. Not open-reason-1b. Not AMD GPU. No Reddit."
|
| 32 |
+
}
|