HuggingFaceH4/ultrafeedback_binarized
Viewer • Updated • 187k • 14.9k • 340
How to use skymizer/Llama2-7b-chat-sft-no-template with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="skymizer/Llama2-7b-chat-sft-no-template")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("skymizer/Llama2-7b-chat-sft-no-template")
model = AutoModelForCausalLM.from_pretrained("skymizer/Llama2-7b-chat-sft-no-template")
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 skymizer/Llama2-7b-chat-sft-no-template with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "skymizer/Llama2-7b-chat-sft-no-template"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "skymizer/Llama2-7b-chat-sft-no-template",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/skymizer/Llama2-7b-chat-sft-no-template
How to use skymizer/Llama2-7b-chat-sft-no-template with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "skymizer/Llama2-7b-chat-sft-no-template" \
--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": "skymizer/Llama2-7b-chat-sft-no-template",
"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 "skymizer/Llama2-7b-chat-sft-no-template" \
--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": "skymizer/Llama2-7b-chat-sft-no-template",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use skymizer/Llama2-7b-chat-sft-no-template with Docker Model Runner:
docker model run hf.co/skymizer/Llama2-7b-chat-sft-no-template
This model is a fine-tuned version of meta-llama/Llama-2-7b-hf on the HuggingFaceH4/ultrafeedback_binarized and the HuggingFaceH4/deita-10k-v0-sft datasets. 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 | Validation Loss |
|---|---|---|---|
| 0.896 | 0.2013 | 48 | 0.8305 |
| 0.782 | 0.4025 | 96 | 0.8111 |
| 0.8159 | 0.6038 | 144 | 0.7999 |
| 0.8269 | 0.8050 | 192 | 0.7923 |
| 0.6927 | 1.0063 | 240 | 0.7913 |
| 0.7249 | 1.2075 | 288 | 0.7919 |
| 0.7109 | 1.4088 | 336 | 0.7894 |
| 0.7045 | 1.6101 | 384 | 0.7878 |
| 0.7154 | 1.8113 | 432 | 0.7873 |
Base model
meta-llama/Llama-2-7b-hf