Instructions to use Dream-org/Dream-v0-Base-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Dream-org/Dream-v0-Base-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Dream-org/Dream-v0-Base-7B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Dream-org/Dream-v0-Base-7B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Dream-org/Dream-v0-Base-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Dream-org/Dream-v0-Base-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dream-org/Dream-v0-Base-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Dream-org/Dream-v0-Base-7B
- SGLang
How to use Dream-org/Dream-v0-Base-7B 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 "Dream-org/Dream-v0-Base-7B" \ --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": "Dream-org/Dream-v0-Base-7B", "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 "Dream-org/Dream-v0-Base-7B" \ --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": "Dream-org/Dream-v0-Base-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Dream-org/Dream-v0-Base-7B with Docker Model Runner:
docker model run hf.co/Dream-org/Dream-v0-Base-7B
Sudoku
Well done for the impressive work!
I was very impressed with Dream7B's incredible performance on Sudoku. In the blog, you mention, "The intuition behind is that diffusion language models are more effective for solving problems with multiple constraints or for achieving specific objectives." -- I realise authors don't like to speculate too much in their papers. Still, I'm curious about your best guess for the reason for the disparity in Sudoku performance between diffusion/auto-regressive models. In addition, have you identified a type of task where diffusion dominates as much as in Sudoku?
Thanks
Hi, we elaborate more on this intuition in our previous paper Beyond Autoregression: Discrete Diffusion for Complex Reasoning and Planning. Most of the planning tasks discussed can be abstracted into a simple path-finding task introduced in the paper.
😃: Solve this sudoku board:
+-------+-------+-------+
| . 6 . | . 3 8 | 5 1 2 |
| . . 5 | 4 . 9 | . 8 6 |
| . 3 1 | . 5 . | 4 9 . |
+-------+-------+-------+
| . . . | 6 . 7 | 9 3 . |
| . . . | . 4 1 | 2 . . |
| . . . | . . 3 | 6 7 . |
+-------+-------+-------+
| . . . | . . . | . . . |
| . 8 9 | 1 . . | . . 5 |
| 2 1 . | 3 . . | . 4 . |
+-------+-------+-------+
🤖: +-------+-------+-------+
| 4 6 9 7 3 8 5 1 2 7 2 5 | 4 9 3 1 8 6 8 3 1 2 5 7 | 9 3 4 | | 9 8 | 1 6 7 | 5 4 1 | 2 3 9 8 5 | | 3 | | 6 7 4 | 2 1 8 | 9 5 7 9 8 | |
This can definitely not be a good situation to solve sudoku games.