Instructions to use Zigeng/dParallel-LLaDA-8B-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Zigeng/dParallel-LLaDA-8B-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Zigeng/dParallel-LLaDA-8B-instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Zigeng/dParallel-LLaDA-8B-instruct", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Zigeng/dParallel-LLaDA-8B-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Zigeng/dParallel-LLaDA-8B-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Zigeng/dParallel-LLaDA-8B-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Zigeng/dParallel-LLaDA-8B-instruct
- SGLang
How to use Zigeng/dParallel-LLaDA-8B-instruct 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 "Zigeng/dParallel-LLaDA-8B-instruct" \ --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": "Zigeng/dParallel-LLaDA-8B-instruct", "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 "Zigeng/dParallel-LLaDA-8B-instruct" \ --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": "Zigeng/dParallel-LLaDA-8B-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Zigeng/dParallel-LLaDA-8B-instruct with Docker Model Runner:
docker model run hf.co/Zigeng/dParallel-LLaDA-8B-instruct
Update README.md
Browse files
README.md
CHANGED
|
@@ -3,6 +3,7 @@ license: mit
|
|
| 3 |
---
|
| 4 |
|
| 5 |
|
|
|
|
| 6 |
<div align="center">
|
| 7 |
<h1>🚀 dParallel: Learnable Parallel Decoding for dLLMs</h1>
|
| 8 |
<div align="center">
|
|
@@ -12,7 +13,7 @@ license: mit
|
|
| 12 |
<a href="https://github.com/czg1225/dParallel">
|
| 13 |
<img src="https://img.shields.io/badge/Paper-Arxiv-darkred.svg" alt="Paper">
|
| 14 |
</a>
|
| 15 |
-
<a href="https://huggingface.co/Zigeng/dParallel-LLaDA-
|
| 16 |
<img src="https://img.shields.io/badge/HuggingFace-Model-FFB000.svg" alt="Project">
|
| 17 |
</a>
|
| 18 |
<a href="https://huggingface.co/datasets/Zigeng/dParallel_LLaDA_Distill_Data">
|
|
@@ -53,7 +54,7 @@ We introduce dParallel, a simple and effective method that unlocks the inherent
|
|
| 53 |
</tr>
|
| 54 |
<tr>
|
| 55 |
<td>🤖 <strong>Model</strong></td>
|
| 56 |
-
<td><a href="https://huggingface.co/Zigeng/dParallel-LLaDA-
|
| 57 |
</tr>
|
| 58 |
<tr>
|
| 59 |
<td>📊 <strong>Data</strong></td>
|
|
@@ -83,8 +84,8 @@ from generate import generate
|
|
| 83 |
import torch
|
| 84 |
|
| 85 |
device = 'cuda'
|
| 86 |
-
model = LLaDAModelLM.from_pretrained('Zigeng/dParallel-LLaDA-
|
| 87 |
-
tokenizer = AutoTokenizer.from_pretrained('Zigeng/dParallel-LLaDA-
|
| 88 |
|
| 89 |
prompt = "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May? Please reason step by step, and put your final answer within \\boxed{}."
|
| 90 |
|
|
@@ -136,4 +137,11 @@ Our code builds on [LLaDA](https://github.com/ML-GSAI/LLaDA), [Dream](https://gi
|
|
| 136 |
## Citation
|
| 137 |
If our research assists your work, please give us a star ⭐ or cite us using:
|
| 138 |
```
|
| 139 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
|
| 5 |
|
| 6 |
+
|
| 7 |
<div align="center">
|
| 8 |
<h1>🚀 dParallel: Learnable Parallel Decoding for dLLMs</h1>
|
| 9 |
<div align="center">
|
|
|
|
| 13 |
<a href="https://github.com/czg1225/dParallel">
|
| 14 |
<img src="https://img.shields.io/badge/Paper-Arxiv-darkred.svg" alt="Paper">
|
| 15 |
</a>
|
| 16 |
+
<a href="https://huggingface.co/Zigeng/dParallel-LLaDA-8B-instruct">
|
| 17 |
<img src="https://img.shields.io/badge/HuggingFace-Model-FFB000.svg" alt="Project">
|
| 18 |
</a>
|
| 19 |
<a href="https://huggingface.co/datasets/Zigeng/dParallel_LLaDA_Distill_Data">
|
|
|
|
| 54 |
</tr>
|
| 55 |
<tr>
|
| 56 |
<td>🤖 <strong>Model</strong></td>
|
| 57 |
+
<td><a href="https://huggingface.co/Zigeng/dParallel-LLaDA-8B-instruct">dParallel-LLaDA-8b-instruct</a></td>
|
| 58 |
</tr>
|
| 59 |
<tr>
|
| 60 |
<td>📊 <strong>Data</strong></td>
|
|
|
|
| 84 |
import torch
|
| 85 |
|
| 86 |
device = 'cuda'
|
| 87 |
+
model = LLaDAModelLM.from_pretrained('Zigeng/dParallel-LLaDA-8B-instruct', trust_remote_code=True, torch_dtype=torch.bfloat16).to(device).eval()
|
| 88 |
+
tokenizer = AutoTokenizer.from_pretrained('Zigeng/dParallel-LLaDA-8B-instruct', trust_remote_code=True)
|
| 89 |
|
| 90 |
prompt = "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May? Please reason step by step, and put your final answer within \\boxed{}."
|
| 91 |
|
|
|
|
| 137 |
## Citation
|
| 138 |
If our research assists your work, please give us a star ⭐ or cite us using:
|
| 139 |
```
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
|
| 147 |
+
|