Instructions to use wangyue114514/rwkv7-g1g-7.2b-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wangyue114514/rwkv7-g1g-7.2b-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wangyue114514/rwkv7-g1g-7.2b-hf", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("wangyue114514/rwkv7-g1g-7.2b-hf", trust_remote_code=True, device_map="auto") - RWKV
How to use wangyue114514/rwkv7-g1g-7.2b-hf 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 wangyue114514/rwkv7-g1g-7.2b-hf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wangyue114514/rwkv7-g1g-7.2b-hf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wangyue114514/rwkv7-g1g-7.2b-hf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/wangyue114514/rwkv7-g1g-7.2b-hf
- SGLang
How to use wangyue114514/rwkv7-g1g-7.2b-hf 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 "wangyue114514/rwkv7-g1g-7.2b-hf" \ --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": "wangyue114514/rwkv7-g1g-7.2b-hf", "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 "wangyue114514/rwkv7-g1g-7.2b-hf" \ --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": "wangyue114514/rwkv7-g1g-7.2b-hf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use wangyue114514/rwkv7-g1g-7.2b-hf with Docker Model Runner:
docker model run hf.co/wangyue114514/rwkv7-g1g-7.2b-hf
RWKV-7 G1G 7.2B โ Hugging Face reference model
This repository is a self-contained Hugging Face conversion of
rwkv7-g1g-7.2b-20260523-ctx8192.pth. Release v0.9.0 contains the complete readable,
pure-PyTorch reference implementation next to the weights. Normal inference
does not require rwkv7-hf, FLA, a custom CUDA wheel, JIT, or CUDA Graphs.
Install and use
python -m pip install torch transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "wangyue114514/rwkv7-g1g-7.2b-hf"
revision = "v0.9.0"
tokenizer = AutoTokenizer.from_pretrained(
model_id, revision=revision, trust_remote_code=True
)
model = AutoModelForCausalLM.from_pretrained(
model_id, revision=revision, trust_remote_code=True, torch_dtype="auto"
).eval()
device = "cuda" if torch.cuda.is_available() else "cpu"
model = model.to(device)
inputs = tokenizer("The future of recurrent language models is", return_tensors="pt")
inputs = {key: value.to(device) for key, value in inputs.items()}
with torch.inference_mode():
tokens = model.generate(**inputs, max_new_tokens=32)
print(tokenizer.decode(tokens[0], skip_special_tokens=True))
trust_remote_code=True loads the checked-in files
configuration_rwkv7.py, cache_rwkv7.py, ops_rwkv7.py,
modeling_rwkv7.py, and tokenization_rwkv7.py. The recurrent state has the
canonical [batch, heads, key, value] layout. Cache lifecycle, loss, padding,
generation, gradients, and the layer structure are visible in those files.
Fine-tuning and evaluation
The model follows the standard AutoModelForCausalLM contract and supports
Trainer, Accelerate, PEFT LoRA, TRL SFT/DPO/GRPO, and lm_eval through the
ordinary Transformers path. Set model.config.use_cache = False during
training. Reproducible examples and evaluation manifests are in
123123213weqw/hf-adapter.
Reference versus optimized execution
The v0.9.0 model code intentionally favors readability and compatibility.
It is the correctness/reference path, not a peak-throughput benchmark backend.
Optional CUDA Graph and Triton work is maintained separately on
perf/optional-native-backend-v0.10; older CUDA/JIT/quantization and KV-v2
experiments remain on perf/native-kernels-v0.8. Neither branch changes this
model repository's public HF contract.
Model and provenance
- Architecture: RWKV-7 recurrent causal language model
- Checkpoint family: G1G
- Parameters: 7,199,141,888
- Layers: 32
- Hidden size: 4096
- Vocabulary size: 65536
- Stored weight dtype: float16
- Original checkpoint SHA256:
425fc9bda2d12d4ce3b6bfe5c3b3f355be8b14d85960cf40fcca58a19d632630 - Reference source revision:
b8438cab0dc7d11238942efca4c05135d53fcaf8 - Release tag:
v0.9.0
conversion_manifest.json retains the immutable original conversion and
weight provenance. v0.9.0 changes the checked-in runtime code and config only;
the safetensors bytes are not rewritten or re-uploaded.
License
Apache-2.0. See LICENSE.
- Downloads last month
- 605
# 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