Text Generation
Transformers
Safetensors
English
sdar
feature-extraction
diffusion-lm
introspective-decoding
conversational
custom_code
Instructions to use yifanyu/I-DLM-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yifanyu/I-DLM-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yifanyu/I-DLM-8B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("yifanyu/I-DLM-8B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yifanyu/I-DLM-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yifanyu/I-DLM-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yifanyu/I-DLM-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yifanyu/I-DLM-8B
- SGLang
How to use yifanyu/I-DLM-8B 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 "yifanyu/I-DLM-8B" \ --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": "yifanyu/I-DLM-8B", "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 "yifanyu/I-DLM-8B" \ --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": "yifanyu/I-DLM-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yifanyu/I-DLM-8B with Docker Model Runner:
docker model run hf.co/yifanyu/I-DLM-8B
Treat store_kv=None as use config default (upstream forwards thread None through)
Browse files- modeling_sdar.py +5 -1
modeling_sdar.py
CHANGED
|
@@ -264,7 +264,11 @@ class SDARAttention(nn.Module):
|
|
| 264 |
# I-DLM / strict-causal mode (`config.use_regular_causal=True`) uses the standard HF cache
|
| 265 |
# convention: every cached forward commits its KVs. In SDAR block-diffusion mode, callers pass
|
| 266 |
# `store_kv=True` for commit forwards and `store_kv=False` for retrieve-only denoising passes.
|
| 267 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 268 |
if past_key_value is not None and store_kv:
|
| 269 |
# Store new kv into the cache (and get concatenated result).
|
| 270 |
key_states, value_states = past_key_value.update(
|
|
|
|
| 264 |
# I-DLM / strict-causal mode (`config.use_regular_causal=True`) uses the standard HF cache
|
| 265 |
# convention: every cached forward commits its KVs. In SDAR block-diffusion mode, callers pass
|
| 266 |
# `store_kv=True` for commit forwards and `store_kv=False` for retrieve-only denoising passes.
|
| 267 |
+
# Upstream forwards thread `store_kv: Optional[bool] = None` through, so a missing caller kwarg
|
| 268 |
+
# still arrives here as `None` — treat that as "use config default" rather than False.
|
| 269 |
+
store_kv = kwargs.get("store_kv", None)
|
| 270 |
+
if store_kv is None:
|
| 271 |
+
store_kv = bool(getattr(self.config, "use_regular_causal", False))
|
| 272 |
if past_key_value is not None and store_kv:
|
| 273 |
# Store new kv into the cache (and get concatenated result).
|
| 274 |
key_states, value_states = past_key_value.update(
|