Dahoas/instruct-synthetic-prompt-responses
Viewer • Updated • 33.2k • 57 • 16
How to use Z3R6X/gpt4all_dpo_instruct with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Z3R6X/gpt4all_dpo_instruct") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Z3R6X/gpt4all_dpo_instruct")
model = AutoModelForCausalLM.from_pretrained("Z3R6X/gpt4all_dpo_instruct", device_map="auto")How to use Z3R6X/gpt4all_dpo_instruct with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Z3R6X/gpt4all_dpo_instruct"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Z3R6X/gpt4all_dpo_instruct",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/Z3R6X/gpt4all_dpo_instruct
How to use Z3R6X/gpt4all_dpo_instruct with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Z3R6X/gpt4all_dpo_instruct" \
--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": "Z3R6X/gpt4all_dpo_instruct",
"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 "Z3R6X/gpt4all_dpo_instruct" \
--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": "Z3R6X/gpt4all_dpo_instruct",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use Z3R6X/gpt4all_dpo_instruct with Docker Model Runner:
docker model run hf.co/Z3R6X/gpt4all_dpo_instruct
Question answering model finetuned from GPT4All-J v1.3 with Direct Preference Optimization.
Dataset: Dahoas/instruct-synthetic-prompt-responses.
The model was finetuned with the following promt: "Answer the following question in context:\n\nQuestion: " + samples["prompt"] + " Answer: "
It should be benefical to use the same or a similar prompt for inference.
An increase in performance compared to GPT4All-J v1.3 was observed when using two-shot Chain-of-Thought prompting.
| HellaSwag | WinoGrande | BooLQ | ARC-c |
|---|---|---|---|
| 62.37% | 63.3% | 65.2% | 32.76% |