Alphazero-like Tree-Search can Guide Large Language Model Decoding and Training
Paper • 2309.17179 • Published • 2
How to use OhCherryFire/llama2-7b-prontoqa-policy-hf with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="OhCherryFire/llama2-7b-prontoqa-policy-hf") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("OhCherryFire/llama2-7b-prontoqa-policy-hf")
model = AutoModelForCausalLM.from_pretrained("OhCherryFire/llama2-7b-prontoqa-policy-hf", device_map="auto")How to use OhCherryFire/llama2-7b-prontoqa-policy-hf with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "OhCherryFire/llama2-7b-prontoqa-policy-hf"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "OhCherryFire/llama2-7b-prontoqa-policy-hf",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/OhCherryFire/llama2-7b-prontoqa-policy-hf
How to use OhCherryFire/llama2-7b-prontoqa-policy-hf with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "OhCherryFire/llama2-7b-prontoqa-policy-hf" \
--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": "OhCherryFire/llama2-7b-prontoqa-policy-hf",
"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 "OhCherryFire/llama2-7b-prontoqa-policy-hf" \
--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": "OhCherryFire/llama2-7b-prontoqa-policy-hf",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use OhCherryFire/llama2-7b-prontoqa-policy-hf with Docker Model Runner:
docker model run hf.co/OhCherryFire/llama2-7b-prontoqa-policy-hf
The supervised finetuned model for ProntoQA in Alphazero-like tree-search can guide large language model decoding and training, ICML 2024
@article{feng2023alphazero,
title={Alphazero-like tree-search can guide large language model decoding and training},
author={Feng, Xidong and Wan, Ziyu and Wen, Muning and Wen, Ying and Zhang, Weinan and Wang, Jun},
journal={arXiv preprint arXiv:2309.17179},
year={2023}
}