Text Generation
Transformers
TensorBoard
Safetensors
mistral
trl
dpo
Generated from Trainer
conversational
text-generation-inference
Instructions to use weijie210/zephyr-7b-UFB-ref with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use weijie210/zephyr-7b-UFB-ref with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="weijie210/zephyr-7b-UFB-ref") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("weijie210/zephyr-7b-UFB-ref") model = AutoModelForCausalLM.from_pretrained("weijie210/zephyr-7b-UFB-ref") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use weijie210/zephyr-7b-UFB-ref with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "weijie210/zephyr-7b-UFB-ref" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "weijie210/zephyr-7b-UFB-ref", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/weijie210/zephyr-7b-UFB-ref
- SGLang
How to use weijie210/zephyr-7b-UFB-ref with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "weijie210/zephyr-7b-UFB-ref" \ --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": "weijie210/zephyr-7b-UFB-ref", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "weijie210/zephyr-7b-UFB-ref" \ --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": "weijie210/zephyr-7b-UFB-ref", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use weijie210/zephyr-7b-UFB-ref with Docker Model Runner:
docker model run hf.co/weijie210/zephyr-7b-UFB-ref
zephyr-7b-UFB-ref
This model is a fine-tuned version of alignment-handbook/zephyr-7b-sft-full on the None dataset. It achieves the following results on the evaluation set:
- Loss: 0.5067
- Rewards/chosen: -1.1023
- Rewards/rejected: -2.3762
- Rewards/accuracies: 0.7098
- Rewards/margins: 1.2739
- Logps/rejected: -120.8096
- Logps/chosen: -110.8900
- Logits/rejected: -2.1865
- Logits/chosen: -2.2284
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-07
- train_batch_size: 4
- eval_batch_size: 8
- seed: 42
- distributed_type: multi-GPU
- num_devices: 4
- total_train_batch_size: 16
- total_eval_batch_size: 32
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.1
- num_epochs: 1
Training results
| Training Loss | Epoch | Step | Validation Loss | Rewards/chosen | Rewards/rejected | Rewards/accuracies | Rewards/margins | Logps/rejected | Logps/chosen | Logits/rejected | Logits/chosen |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.5598 | 0.15 | 500 | 0.6348 | -0.4646 | -1.5732 | 0.7121 | 1.1087 | -112.7802 | -104.5124 | -2.2989 | -2.3398 |
| 0.6708 | 0.3 | 1000 | 0.5807 | -1.9508 | -2.8042 | 0.6830 | 0.8534 | -125.0895 | -119.3747 | -2.2155 | -2.2623 |
| 0.5984 | 0.45 | 1500 | 0.5244 | -1.4451 | -2.6765 | 0.7188 | 1.2313 | -123.8126 | -114.3180 | -2.1383 | -2.1824 |
| 0.5508 | 0.6 | 2000 | 0.5644 | -1.7905 | -2.8869 | 0.6786 | 1.0964 | -125.9164 | -117.7717 | -2.0760 | -2.1208 |
| 0.5218 | 0.74 | 2500 | 0.5183 | -1.3228 | -2.5470 | 0.7031 | 1.2242 | -122.5180 | -113.0946 | -2.2172 | -2.2616 |
| 0.4914 | 0.89 | 3000 | 0.5079 | -1.0825 | -2.3551 | 0.7121 | 1.2725 | -120.5985 | -110.6918 | -2.2149 | -2.2567 |
Framework versions
- Transformers 4.36.1
- Pytorch 2.0.1+cu117
- Datasets 2.16.1
- Tokenizers 0.15.0
- Downloads last month
- 6
Model tree for weijie210/zephyr-7b-UFB-ref
Base model
mistralai/Mistral-7B-v0.1 Finetuned
alignment-handbook/zephyr-7b-sft-full