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
| language: | |
| - en | |
| license: apache-2.0 | |
| library_name: transformers | |
| tags: | |
| - open-reason | |
| - causal-lm | |
| - cpu | |
| datasets: | |
| - theworker02/open-reason | |
| base_model: gpt2-scratch | |
| # Open Reason medium (CPU) | |
| A **medium** GPT-2-style causal LM trained from scratch on | |
| [`theworker02/open-reason`](https://huggingface.co/datasets/theworker02/open-reason) | |
| pipeline **v1.4.0**. It is larger than | |
| [`theworker02/open-reason-small`](https://huggingface.co/theworker02/open-reason-small) | |
| (~1.3M) and is **not** a 1B model. Do not confuse it with `theworker02/open-reason-1b`. | |
| | | | | |
| | --- | --- | | |
| | Parameters | **13,867,008** | | |
| | Architecture | GPT-2 scratch, `n_layer=6`, `n_embd=384`, `n_head=6`, vocab 8192, context 192 | | |
| | Steps | 180 | | |
| | Batch size | 2 | | |
| | Hardware | **Host CPU** (`torch` 2.12.0+cpu). Docker was not installed. AMD GPU was not used. CUDA: false | | |
| | Dataset | `theworker02/open-reason` v1.4.0, **3175** SFT rows (`all` split) | | |
| | Final loss | 4.416 | | |
| | License | Apache-2.0 | | |
| | Reddit | Never used as a source | | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| tok = AutoTokenizer.from_pretrained("theworker02/open-reason-medium") | |
| model = AutoModelForCausalLM.from_pretrained("theworker02/open-reason-medium") | |
| ``` | |
| Companion small model: [`theworker02/open-reason-small`](https://huggingface.co/theworker02/open-reason-small). | |
| Dataset: [`theworker02/open-reason`](https://huggingface.co/datasets/theworker02/open-reason). | |
| Code: [`theworker02/open-reason`](https://github.com/theworker02/open-reason). | |