Text Generation
Transformers
Safetensors
llada2_moe
dllm
diffusion
llm
text_generation
conversational
custom_code
Instructions to use inclusionAI/LLaDA2.0-flash-preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inclusionAI/LLaDA2.0-flash-preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="inclusionAI/LLaDA2.0-flash-preview", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("inclusionAI/LLaDA2.0-flash-preview", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use inclusionAI/LLaDA2.0-flash-preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inclusionAI/LLaDA2.0-flash-preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inclusionAI/LLaDA2.0-flash-preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/inclusionAI/LLaDA2.0-flash-preview
- SGLang
How to use inclusionAI/LLaDA2.0-flash-preview 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 "inclusionAI/LLaDA2.0-flash-preview" \ --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": "inclusionAI/LLaDA2.0-flash-preview", "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 "inclusionAI/LLaDA2.0-flash-preview" \ --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": "inclusionAI/LLaDA2.0-flash-preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use inclusionAI/LLaDA2.0-flash-preview with Docker Model Runner:
docker model run hf.co/inclusionAI/LLaDA2.0-flash-preview
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,7 +8,7 @@ tags:
|
|
| 8 |
- text_generation
|
| 9 |
---
|
| 10 |
DA2.0-flash-preview
|
| 11 |
-
**LLaDA2-flash-preview** is a diffusion language model featuring a 100BA6B Mixture-of-Experts (MoE) architecture. As an enhanced, instruction-tuned iteration of the LLaDA2.0 series, it is optimized for practical applications.
|
| 12 |
|
| 13 |
<div align="center">
|
| 14 |
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*kLORSaRfSK8AAAAAgIAAAAgAemJ7AQ/original" width="800" />
|
|
@@ -65,8 +65,8 @@ Fully open-source with commitment to transparency. We plan to release a **leadin
|
|
| 65 |
## 📦 Model Variants
|
| 66 |
| Model ID | Description | Hugging Face Link |
|
| 67 |
| --- | --- | --- |
|
| 68 |
-
| `inclusionAI/LLaDA2-mini-preview` | Instruction-tuned model, ready for downstream applications. | [🤗 Model Card](https://huggingface.co/inclusionAI/LLaDA2.0-mini-preview) |
|
| 69 |
-
| `inclusionAI/LLaDA2-flash-preview` | Instruction-tuned model, ready for downstream applications. | [🤗 Model Card](https://huggingface.co/inclusionAI/LLaDA2.0-flash-preview) |
|
| 70 |
|
| 71 |
|
| 72 |
---
|
|
@@ -93,7 +93,7 @@ import torch.nn.functional as F
|
|
| 93 |
from transformers import AutoModelForCausalLM
|
| 94 |
from transformers import AutoTokenizer
|
| 95 |
|
| 96 |
-
model_path = "/path/to/LLaDA2-mini-preview"
|
| 97 |
device = "auto"
|
| 98 |
model = AutoModelForCausalLM.from_pretrained(
|
| 99 |
model_path, trust_remote_code=True, device_map=device
|
|
|
|
| 8 |
- text_generation
|
| 9 |
---
|
| 10 |
DA2.0-flash-preview
|
| 11 |
+
**LLaDA2.0-flash-preview** is a diffusion language model featuring a 100BA6B Mixture-of-Experts (MoE) architecture. As an enhanced, instruction-tuned iteration of the LLaDA2.0 series, it is optimized for practical applications.
|
| 12 |
|
| 13 |
<div align="center">
|
| 14 |
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*kLORSaRfSK8AAAAAgIAAAAgAemJ7AQ/original" width="800" />
|
|
|
|
| 65 |
## 📦 Model Variants
|
| 66 |
| Model ID | Description | Hugging Face Link |
|
| 67 |
| --- | --- | --- |
|
| 68 |
+
| `inclusionAI/LLaDA2.0-mini-preview` | Instruction-tuned model, ready for downstream applications. | [🤗 Model Card](https://huggingface.co/inclusionAI/LLaDA2.0-mini-preview) |
|
| 69 |
+
| `inclusionAI/LLaDA2.0-flash-preview` | Instruction-tuned model, ready for downstream applications. | [🤗 Model Card](https://huggingface.co/inclusionAI/LLaDA2.0-flash-preview) |
|
| 70 |
|
| 71 |
|
| 72 |
---
|
|
|
|
| 93 |
from transformers import AutoModelForCausalLM
|
| 94 |
from transformers import AutoTokenizer
|
| 95 |
|
| 96 |
+
model_path = "/path/to/LLaDA2.0-mini-preview"
|
| 97 |
device = "auto"
|
| 98 |
model = AutoModelForCausalLM.from_pretrained(
|
| 99 |
model_path, trust_remote_code=True, device_map=device
|