open-thoughts/OpenThoughts-114k
Viewer • Updated • 228k • 119k • 841
How to use tangledgroup/tangled-alpha-0.8-core with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="tangledgroup/tangled-alpha-0.8-core") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("tangledgroup/tangled-alpha-0.8-core")
model = AutoModelForCausalLM.from_pretrained("tangledgroup/tangled-alpha-0.8-core")How to use tangledgroup/tangled-alpha-0.8-core with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "tangledgroup/tangled-alpha-0.8-core"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "tangledgroup/tangled-alpha-0.8-core",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/tangledgroup/tangled-alpha-0.8-core
How to use tangledgroup/tangled-alpha-0.8-core with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "tangledgroup/tangled-alpha-0.8-core" \
--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": "tangledgroup/tangled-alpha-0.8-core",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "tangledgroup/tangled-alpha-0.8-core" \
--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": "tangledgroup/tangled-alpha-0.8-core",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use tangledgroup/tangled-alpha-0.8-core with Docker Model Runner:
docker model run hf.co/tangledgroup/tangled-alpha-0.8-core
time python -B prepare_core_datasets.py
i=0, min_len=0, max_len=1073741824, block_size=4097, chunk_size=16388000, len(dataset)=1287403, len(dataset) * block_size=5274490091
Total number of tokens in the optimized dataset '../core-data-0-0-1073741824-4097-4000' is 5274490091
CUDA_VISIBLE_DEVICES=0 CUDA_LAUNCH_BLOCKING=0 PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True litgpt pretrain --config pretrain_core_model.yaml
# ...
Backup wandb:
mv wandb wandb-pretrain-core
Chat with model:
CUDA_VISIBLE_DEVICES=0 CUDA_LAUNCH_BLOCKING=0 PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True litgpt chat ../out/pretrain-core/final
CUDA_VISIBLE_DEVICES=0 CUDA_LAUNCH_BLOCKING=0 PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True time litgpt evaluate --tasks 'leaderboard' --out_dir '../evaluate/pretrain-core-0/leaderboard/' --batch_size 1 --dtype 'bfloat16' '../out/pretrain-core/final'
# ...