HuggingFaceH4/ultrafeedback_binarized
Viewer • Updated • 187k • 17k • 340
How to use taicheng/zephyr-7b-align-scan with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="taicheng/zephyr-7b-align-scan")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("taicheng/zephyr-7b-align-scan")
model = AutoModelForCausalLM.from_pretrained("taicheng/zephyr-7b-align-scan")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use taicheng/zephyr-7b-align-scan with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "taicheng/zephyr-7b-align-scan"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "taicheng/zephyr-7b-align-scan",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/taicheng/zephyr-7b-align-scan
How to use taicheng/zephyr-7b-align-scan with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "taicheng/zephyr-7b-align-scan" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "taicheng/zephyr-7b-align-scan",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "taicheng/zephyr-7b-align-scan" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "taicheng/zephyr-7b-align-scan",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use taicheng/zephyr-7b-align-scan with Docker Model Runner:
docker model run hf.co/taicheng/zephyr-7b-align-scan
This model is a fine-tuned version of alignment-handbook/zephyr-7b-sft-full on the HuggingFaceH4/ultrafeedback_binarized dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Logits/chosen | Logits/rejected | Logps/chosen | Logps/rejected | Validation Loss | Rewards/accuracies | Rewards/chosen | Rewards/margins | Rewards/rejected |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.6719 | 0.1047 | 100 | -2.3487 | -2.3310 | -73.2865 | -85.4479 | 0.6687 | 0.3274 | 0.0120 | 0.0552 | -0.0432 |
| 0.6488 | 0.2093 | 200 | -1.2584 | -1.2396 | -102.5743 | -130.3725 | 0.6348 | 0.3373 | -0.2808 | 0.2116 | -0.4924 |
| 0.6331 | 0.3140 | 300 | -1.1873 | -1.0320 | -120.1307 | -157.0977 | 0.6195 | 0.3452 | -0.4564 | 0.3033 | -0.7597 |
| 0.6321 | 0.4186 | 400 | 0.0335 | 0.3728 | -146.9637 | -190.2757 | 0.6099 | 0.3631 | -0.7247 | 0.3667 | -1.0915 |
| 0.6318 | 0.5233 | 500 | 2.6547 | 2.9545 | -155.4930 | -204.6371 | 0.6105 | 0.3552 | -0.8100 | 0.4251 | -1.2351 |
| 0.5978 | 0.6279 | 600 | 0.9606 | 1.4420 | -147.8560 | -199.5121 | 0.6015 | 0.3591 | -0.7336 | 0.4502 | -1.1838 |
| 0.6113 | 0.7326 | 700 | 1.1833 | 1.7188 | -150.6854 | -204.9195 | 0.5986 | 0.3651 | -0.7619 | 0.4760 | -1.2379 |
| 0.5885 | 0.8373 | 800 | 0.5613 | 1.0128 | -141.6925 | -192.4845 | 0.5974 | 0.3690 | -0.6720 | 0.4415 | -1.1136 |
| 0.595 | 0.9419 | 900 | 0.4326 | 0.9106 | -136.2882 | -189.5506 | 0.5958 | 0.3710 | -0.6180 | 0.4663 | -1.0842 |
Base model
mistralai/Mistral-7B-v0.1