EleutherAI/the_pile_deduplicated
Viewer • Updated • 134M • 26.3k • 113
How to use RWKV/RWKV7-Goose-Pile-421M-HF with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="RWKV/RWKV7-Goose-Pile-421M-HF", trust_remote_code=True) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("RWKV/RWKV7-Goose-Pile-421M-HF", trust_remote_code=True, dtype="auto")How to use RWKV/RWKV7-Goose-Pile-421M-HF with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "RWKV/RWKV7-Goose-Pile-421M-HF"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "RWKV/RWKV7-Goose-Pile-421M-HF",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/RWKV/RWKV7-Goose-Pile-421M-HF
How to use RWKV/RWKV7-Goose-Pile-421M-HF with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "RWKV/RWKV7-Goose-Pile-421M-HF" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "RWKV/RWKV7-Goose-Pile-421M-HF",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "RWKV/RWKV7-Goose-Pile-421M-HF" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "RWKV/RWKV7-Goose-Pile-421M-HF",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use RWKV/RWKV7-Goose-Pile-421M-HF with Docker Model Runner:
docker model run hf.co/RWKV/RWKV7-Goose-Pile-421M-HF
This is RWKV-7 model under flash-linear attention format.
Install flash-linear-attention and the latest version of transformers before using this model:
pip install flash-linear-attention==0.3.0
pip install 'transformers>=4.48.0'
You can use this model just as any other HuggingFace models:
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('fla-hub/rwkv7-421M-pile', trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained('fla-hub/rwkv7-421M-pile', trust_remote_code=True)
This model is trained on the Pile with a total of 332 billion tokens.
lambada_openai: ppl 7.21 acc 57.9%
piqa: acc 69.2%
Q: safetensors metadata is none.
A: upgrade transformers to >=4.48.0: pip install 'transformers>=4.48.0'
Base model
BlinkDL/rwkv-7-pile