Intel/orca_dpo_pairs
Viewer • Updated • 12.9k • 1.91k • 321
How to use rohansolo/DeciDPObyBB with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="rohansolo/DeciDPObyBB", trust_remote_code=True) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("rohansolo/DeciDPObyBB", trust_remote_code=True, dtype="auto")How to use rohansolo/DeciDPObyBB with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "rohansolo/DeciDPObyBB"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "rohansolo/DeciDPObyBB",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/rohansolo/DeciDPObyBB
How to use rohansolo/DeciDPObyBB with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "rohansolo/DeciDPObyBB" \
--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": "rohansolo/DeciDPObyBB",
"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 "rohansolo/DeciDPObyBB" \
--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": "rohansolo/DeciDPObyBB",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use rohansolo/DeciDPObyBB with Docker Model Runner:
docker model run hf.co/rohansolo/DeciDPObyBB
Built by fine-tuning DeciLM-7B-Insruct using Intel Orca DPO Pairs
created by bhaiyabot
built for research and learning purposes!
usage:
message = [
{"role": "system", "content": "You are a very helpful assistant chatbot that thinks step by step"},
{"role": "user", "content": input}
]
tokenizer = AutoTokenizer.from_pretrained(new_model)
prompt = tokenizer.apply_chat_template(message, add_generation_prompt=True, tokenize=False)
sequences = pipeline(
prompt,
do_sample=True,
temperature=1,
num_beams=5,
max_length=1000,
pad_token_id=tokenizer.eos_token_id,
)
print(sequences[0]['generated_text'])
@misc{DeciFoundationModels,
title = {DeciLM-7B-instruct},
author = {DeciAI Research Team},
year = {2023}
url={https://huggingface.co/Deci/DeciLM-7B-instruct},
}
@misc{rafailov2023direct,
title={Direct Preference Optimization: Your Language Model is Secretly a Reward Model},
author={Rafael Rafailov and Archit Sharma and Eric Mitchell and Stefano Ermon and Christopher D. Manning and Chelsea Finn},
year={2023},
eprint={2305.18290},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
more details to come soon