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
File size: 643 Bytes
bf0b9a3 | 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 | {
"smoke": false,
"cuda": false,
"backend": "cpu-host",
"architecture": "gpt2-scratch",
"param_count": 1334016,
"n_layer": 4,
"n_embd": 128,
"n_head": 4,
"steps": 200,
"rows": 2348,
"final_loss": 6.095415115356445,
"losses_tail": [
5.3571391105651855,
5.712825298309326,
5.500826835632324,
5.698274612426758,
5.465966701507568,
5.777740001678467,
5.92188024520874,
5.687778472900391,
5.9522929191589355,
6.095415115356445
],
"hub_id_if_uploaded": "theworker02/open-reason-small",
"note": "Small CPU causal LM. Not open-reason-1b. Not AMD GPU."
}
|