Instructions to use sail/Zephyr-7B-DICE-Iter2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sail/Zephyr-7B-DICE-Iter2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sail/Zephyr-7B-DICE-Iter2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sail/Zephyr-7B-DICE-Iter2") model = AutoModelForCausalLM.from_pretrained("sail/Zephyr-7B-DICE-Iter2") 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 Settings
- vLLM
How to use sail/Zephyr-7B-DICE-Iter2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sail/Zephyr-7B-DICE-Iter2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sail/Zephyr-7B-DICE-Iter2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sail/Zephyr-7B-DICE-Iter2
- SGLang
How to use sail/Zephyr-7B-DICE-Iter2 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 "sail/Zephyr-7B-DICE-Iter2" \ --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": "sail/Zephyr-7B-DICE-Iter2", "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 "sail/Zephyr-7B-DICE-Iter2" \ --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": "sail/Zephyr-7B-DICE-Iter2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sail/Zephyr-7B-DICE-Iter2 with Docker Model Runner:
docker model run hf.co/sail/Zephyr-7B-DICE-Iter2
Add pipeline tag and link to Github repository
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
library_name: transformers
|
| 3 |
-
license: mit
|
| 4 |
datasets:
|
| 5 |
- HuggingFaceH4/ultrafeedback_binarized
|
| 6 |
language:
|
| 7 |
- en
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
|
|
|
| 9 |
# Zephyr-7B-DICE-Iter2
|
| 10 |
|
| 11 |
This model was developed using [Bootstrapping Language Models with DPO Implicit Rewards](https://arxiv.org/abs/2406.09760) (DICE) at iteration 2, based on the [HuggingFaceH4/zephyr-7b-beta](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta) as the starting point.
|
|
@@ -29,6 +31,9 @@ This model was developed using [Bootstrapping Language Models with DPO Implicit
|
|
| 29 |
|[Zephyr-7B-DICE-Iter1](https://huggingface.co/sail/Zephyr-7B-DICE-Iter1) |19.03 |17.67
|
| 30 |
|[Zephyr-7B-DICE-Iter2](https://huggingface.co/sail/Zephyr-7B-DICE-Iter2) |**20.71** |**20.16**
|
| 31 |
|
|
|
|
|
|
|
|
|
|
| 32 |
## Citation
|
| 33 |
|
| 34 |
```bibtex
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
datasets:
|
| 3 |
- HuggingFaceH4/ultrafeedback_binarized
|
| 4 |
language:
|
| 5 |
- en
|
| 6 |
+
library_name: transformers
|
| 7 |
+
license: mit
|
| 8 |
+
pipeline_tag: text-generation
|
| 9 |
---
|
| 10 |
+
|
| 11 |
# Zephyr-7B-DICE-Iter2
|
| 12 |
|
| 13 |
This model was developed using [Bootstrapping Language Models with DPO Implicit Rewards](https://arxiv.org/abs/2406.09760) (DICE) at iteration 2, based on the [HuggingFaceH4/zephyr-7b-beta](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta) as the starting point.
|
|
|
|
| 31 |
|[Zephyr-7B-DICE-Iter1](https://huggingface.co/sail/Zephyr-7B-DICE-Iter1) |19.03 |17.67
|
| 32 |
|[Zephyr-7B-DICE-Iter2](https://huggingface.co/sail/Zephyr-7B-DICE-Iter2) |**20.71** |**20.16**
|
| 33 |
|
| 34 |
+
## Code
|
| 35 |
+
https://github.com/sail-sg/dice
|
| 36 |
+
|
| 37 |
## Citation
|
| 38 |
|
| 39 |
```bibtex
|