Instructions to use aabbdev/RWKV7-1.5B-20260805 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aabbdev/RWKV7-1.5B-20260805 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aabbdev/RWKV7-1.5B-20260805", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("aabbdev/RWKV7-1.5B-20260805", trust_remote_code=True, device_map="auto") - RWKV
How to use aabbdev/RWKV7-1.5B-20260805 with RWKV:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use aabbdev/RWKV7-1.5B-20260805 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aabbdev/RWKV7-1.5B-20260805" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aabbdev/RWKV7-1.5B-20260805", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/aabbdev/RWKV7-1.5B-20260805
- SGLang
How to use aabbdev/RWKV7-1.5B-20260805 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 "aabbdev/RWKV7-1.5B-20260805" \ --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": "aabbdev/RWKV7-1.5B-20260805", "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 "aabbdev/RWKV7-1.5B-20260805" \ --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": "aabbdev/RWKV7-1.5B-20260805", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use aabbdev/RWKV7-1.5B-20260805 with Docker Model Runner:
docker model run hf.co/aabbdev/RWKV7-1.5B-20260805
Close non-thinking chat prefix
Browse files- README.md +11 -10
- chat_template.jinja +1 -1
- inference/generate.py +1 -1
- release-manifest.json +8 -8
README.md
CHANGED
|
@@ -81,7 +81,7 @@ optional TileLang inference implementation are distributed with this release.
|
|
| 81 |
|
| 82 |
| Field | Value |
|
| 83 |
| --- | --- |
|
| 84 |
-
| Repository | `
|
| 85 |
| Architecture class | `Rwkv7ForCausalLM` |
|
| 86 |
| Public size label | `1.5`B |
|
| 87 |
| Source parameters | `1,527,668,736` |
|
|
@@ -116,7 +116,7 @@ from transformers import (
|
|
| 116 |
PreTrainedConfig,
|
| 117 |
)
|
| 118 |
|
| 119 |
-
model_id = "
|
| 120 |
tokenizer = AutoTokenizer.from_pretrained(
|
| 121 |
model_id,
|
| 122 |
config=PreTrainedConfig(),
|
|
@@ -144,7 +144,7 @@ THINK_RE = re.compile(r"\A<think>?\s*(.*?)\s*</think>?", re.DOTALL)
|
|
| 144 |
|
| 145 |
|
| 146 |
def assistant_content(completion, thinking, *, close_incomplete=False):
|
| 147 |
-
prefix = "<think" if thinking else "<think></think"
|
| 148 |
reply = prefix + completion
|
| 149 |
thinking_block = THINK_RE.match(reply)
|
| 150 |
if thinking:
|
|
@@ -153,7 +153,7 @@ def assistant_content(completion, thinking, *, close_incomplete=False):
|
|
| 153 |
return f"{reply.rstrip()}\n</think>".strip()
|
| 154 |
return "" if thinking_block is None else reply[thinking_block.end():].strip()
|
| 155 |
|
| 156 |
-
model_id = "
|
| 157 |
tokenizer = AutoTokenizer.from_pretrained(
|
| 158 |
model_id,
|
| 159 |
config=PreTrainedConfig(),
|
|
@@ -203,10 +203,11 @@ print(
|
|
| 203 |
```
|
| 204 |
|
| 205 |
Set `thinking=True` for the RWKV thinking prefix. The intentional generation
|
| 206 |
-
prefixes are `Assistant: <think></think`
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
|
|
|
| 210 |
Reference stops are token ID `0` and `\n\nUser:`.
|
| 211 |
|
| 212 |
Strip trailing spaces from user input. The official RWKV prompt guide is available
|
|
@@ -218,14 +219,14 @@ Install the versions listed in `inference/requirements.txt`, then run the bundle
|
|
| 218 |
interactive chat:
|
| 219 |
|
| 220 |
```bash
|
| 221 |
-
python inference/generate.py --model
|
| 222 |
```
|
| 223 |
|
| 224 |
Or independent prompts separated by blank lines:
|
| 225 |
|
| 226 |
```bash
|
| 227 |
python inference/generate.py \
|
| 228 |
-
--model
|
| 229 |
--backend auto \
|
| 230 |
--input-file prompts.txt
|
| 231 |
```
|
|
|
|
| 81 |
|
| 82 |
| Field | Value |
|
| 83 |
| --- | --- |
|
| 84 |
+
| Repository | `BlinkDL/RWKV7-1.5B-20260805` |
|
| 85 |
| Architecture class | `Rwkv7ForCausalLM` |
|
| 86 |
| Public size label | `1.5`B |
|
| 87 |
| Source parameters | `1,527,668,736` |
|
|
|
|
| 116 |
PreTrainedConfig,
|
| 117 |
)
|
| 118 |
|
| 119 |
+
model_id = "BlinkDL/RWKV7-1.5B-20260805"
|
| 120 |
tokenizer = AutoTokenizer.from_pretrained(
|
| 121 |
model_id,
|
| 122 |
config=PreTrainedConfig(),
|
|
|
|
| 144 |
|
| 145 |
|
| 146 |
def assistant_content(completion, thinking, *, close_incomplete=False):
|
| 147 |
+
prefix = "<think" if thinking else "<think></think>\n"
|
| 148 |
reply = prefix + completion
|
| 149 |
thinking_block = THINK_RE.match(reply)
|
| 150 |
if thinking:
|
|
|
|
| 153 |
return f"{reply.rstrip()}\n</think>".strip()
|
| 154 |
return "" if thinking_block is None else reply[thinking_block.end():].strip()
|
| 155 |
|
| 156 |
+
model_id = "BlinkDL/RWKV7-1.5B-20260805"
|
| 157 |
tokenizer = AutoTokenizer.from_pretrained(
|
| 158 |
model_id,
|
| 159 |
config=PreTrainedConfig(),
|
|
|
|
| 203 |
```
|
| 204 |
|
| 205 |
Set `thinking=True` for the RWKV thinking prefix. The intentional generation
|
| 206 |
+
prefixes are `Assistant: <think></think>` followed by a newline and
|
| 207 |
+
`Assistant: <think`. Only the enabled thinking prefix intentionally leaves its opening
|
| 208 |
+
tag incomplete. The post-processing above reconstructs that prefix before removing an
|
| 209 |
+
empty thinking block or preserving an enabled one. If generation hits the token limit
|
| 210 |
+
inside thinking, it closes the displayed block before returning it.
|
| 211 |
Reference stops are token ID `0` and `\n\nUser:`.
|
| 212 |
|
| 213 |
Strip trailing spaces from user input. The official RWKV prompt guide is available
|
|
|
|
| 219 |
interactive chat:
|
| 220 |
|
| 221 |
```bash
|
| 222 |
+
python inference/generate.py --model BlinkDL/RWKV7-1.5B-20260805 --backend auto --interactive
|
| 223 |
```
|
| 224 |
|
| 225 |
Or independent prompts separated by blank lines:
|
| 226 |
|
| 227 |
```bash
|
| 228 |
python inference/generate.py \
|
| 229 |
+
--model BlinkDL/RWKV7-1.5B-20260805 \
|
| 230 |
--backend auto \
|
| 231 |
--input-file prompts.txt
|
| 232 |
```
|
chat_template.jinja
CHANGED
|
@@ -51,6 +51,6 @@
|
|
| 51 |
{%- if thinking -%}
|
| 52 |
{{ 'Assistant: <think' }}
|
| 53 |
{%- else -%}
|
| 54 |
-
{{ 'Assistant: <think></think' }}
|
| 55 |
{%- endif -%}
|
| 56 |
{%- endif -%}
|
|
|
|
| 51 |
{%- if thinking -%}
|
| 52 |
{{ 'Assistant: <think' }}
|
| 53 |
{%- else -%}
|
| 54 |
+
{{ 'Assistant: <think></think>\n' }}
|
| 55 |
{%- endif -%}
|
| 56 |
{%- endif -%}
|
inference/generate.py
CHANGED
|
@@ -59,7 +59,7 @@ class StopOnText(StoppingCriteria):
|
|
| 59 |
def _assistant_content(
|
| 60 |
completion: str, thinking: bool, *, close_incomplete: bool = False
|
| 61 |
) -> str:
|
| 62 |
-
prefix = "<think" if thinking else "<think></think"
|
| 63 |
reply = prefix + completion
|
| 64 |
thinking_block = THINK_RE.match(reply)
|
| 65 |
if thinking:
|
|
|
|
| 59 |
def _assistant_content(
|
| 60 |
completion: str, thinking: bool, *, close_incomplete: bool = False
|
| 61 |
) -> str:
|
| 62 |
+
prefix = "<think" if thinking else "<think></think>\n"
|
| 63 |
reply = prefix + completion
|
| 64 |
thinking_block = THINK_RE.match(reply)
|
| 65 |
if thinking:
|
release-manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"builder": {
|
| 3 |
"asset_set": "2026.08.06-r1",
|
| 4 |
-
"assets_sha256": "
|
| 5 |
"version": "0.2.0"
|
| 6 |
},
|
| 7 |
"conversion": {
|
|
@@ -36,13 +36,13 @@
|
|
| 36 |
},
|
| 37 |
"README.md": {
|
| 38 |
"role": "model_card",
|
| 39 |
-
"sha256": "
|
| 40 |
-
"size_bytes":
|
| 41 |
},
|
| 42 |
"chat_template.jinja": {
|
| 43 |
"role": "tokenizer",
|
| 44 |
-
"sha256": "
|
| 45 |
-
"size_bytes":
|
| 46 |
},
|
| 47 |
"config.json": {
|
| 48 |
"role": "model_config",
|
|
@@ -61,8 +61,8 @@
|
|
| 61 |
},
|
| 62 |
"inference/generate.py": {
|
| 63 |
"role": "inference",
|
| 64 |
-
"sha256": "
|
| 65 |
-
"size_bytes":
|
| 66 |
},
|
| 67 |
"inference/kernel.py": {
|
| 68 |
"role": "inference",
|
|
@@ -320,7 +320,7 @@
|
|
| 320 |
}
|
| 321 |
}
|
| 322 |
},
|
| 323 |
-
"schema_version":
|
| 324 |
"source": {
|
| 325 |
"filename": "rwkv7-g1i-1.5b-20260805-ctx16384.pth",
|
| 326 |
"kind": "huggingface",
|
|
|
|
| 1 |
{
|
| 2 |
"builder": {
|
| 3 |
"asset_set": "2026.08.06-r1",
|
| 4 |
+
"assets_sha256": "5a31129dcca03f5ecd55157e1561af64aaf35046c77e253fc4d6214b95ab8ede",
|
| 5 |
"version": "0.2.0"
|
| 6 |
},
|
| 7 |
"conversion": {
|
|
|
|
| 36 |
},
|
| 37 |
"README.md": {
|
| 38 |
"role": "model_card",
|
| 39 |
+
"sha256": "0f1a8bfe6a0d420333fdf5f7e787e751104348c81c531e3b846a6b0bf7b88d44",
|
| 40 |
+
"size_bytes": 10331
|
| 41 |
},
|
| 42 |
"chat_template.jinja": {
|
| 43 |
"role": "tokenizer",
|
| 44 |
+
"sha256": "abcd52a871eb3f7f0de7b69f2e0ac974fd7cfb03d4acea7a4609cb441f5d9048",
|
| 45 |
+
"size_bytes": 2336
|
| 46 |
},
|
| 47 |
"config.json": {
|
| 48 |
"role": "model_config",
|
|
|
|
| 61 |
},
|
| 62 |
"inference/generate.py": {
|
| 63 |
"role": "inference",
|
| 64 |
+
"sha256": "8c2ca021f04b15db07e3724c783867ffeb7e323d71f753523094b69d2338b8f0",
|
| 65 |
+
"size_bytes": 7807
|
| 66 |
},
|
| 67 |
"inference/kernel.py": {
|
| 68 |
"role": "inference",
|
|
|
|
| 320 |
}
|
| 321 |
}
|
| 322 |
},
|
| 323 |
+
"schema_version": 7,
|
| 324 |
"source": {
|
| 325 |
"filename": "rwkv7-g1i-1.5b-20260805-ctx16384.pth",
|
| 326 |
"kind": "huggingface",
|