Text Generation
Transformers
halt_cot
chain-of-thought
reasoning
early-stopping
entropy
inference-optimization
Instructions to use yass4/halt-cot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yass4/halt-cot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yass4/halt-cot")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("yass4/halt-cot", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yass4/halt-cot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yass4/halt-cot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yass4/halt-cot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/yass4/halt-cot
- SGLang
How to use yass4/halt-cot 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 "yass4/halt-cot" \ --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": "yass4/halt-cot", "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 "yass4/halt-cot" \ --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": "yass4/halt-cot", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use yass4/halt-cot with Docker Model Runner:
docker model run hf.co/yass4/halt-cot
Add config.json (HALT-CoT defaults) so downloads are tracked
Browse files- config.json +31 -0
config.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "halt_cot",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"HaltCoTForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"library_name": "transformers",
|
| 7 |
+
"task": "text-generation",
|
| 8 |
+
"description": "Default configuration for HALT-CoT entropy-based early stopping over chain-of-thought reasoning.",
|
| 9 |
+
"default_base_model": "Qwen/Qwen2.5-0.5B-Instruct",
|
| 10 |
+
"halt_cot": {
|
| 11 |
+
"theta": 0.6,
|
| 12 |
+
"max_steps": 12,
|
| 13 |
+
"min_steps": 1,
|
| 14 |
+
"consecutive_low_entropy": 2,
|
| 15 |
+
"entropy_unit": "bits",
|
| 16 |
+
"step_max_new_tokens": 96,
|
| 17 |
+
"step_min_new_tokens": 4,
|
| 18 |
+
"prompt_template": "{question}\n\nLet's think step by step.\n",
|
| 19 |
+
"step_prefix": "Step {step}: ",
|
| 20 |
+
"step_stop_strings": [
|
| 21 |
+
"\nStep",
|
| 22 |
+
"\nAnswer:",
|
| 23 |
+
"\nFinal answer:",
|
| 24 |
+
"\n"
|
| 25 |
+
],
|
| 26 |
+
"answer_probe": "\nTherefore, the final answer is ",
|
| 27 |
+
"do_sample": false,
|
| 28 |
+
"temperature": 0.0,
|
| 29 |
+
"top_p": 1.0
|
| 30 |
+
}
|
| 31 |
+
}
|