Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions fastchat/model/rwkv_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ def __init__(self, model_path):
"Experimental support. Please use ChatRWKV if you want to chat with RWKV"
)
self.config = SimpleNamespace(is_encoder_decoder=False)
self.model = RWKV(model=model_path, strategy="cuda fp16")
# two GPUs
# self.model = RWKV(model=model_path, strategy="cuda:0 fp16 *20 -> cuda:1 fp16")
n = torch.cuda.device_count()
strategy = (
" -> ".join(f"cuda:{i} fp16" for i in range(n))
if n > 1
else "cuda fp16"
)
self.model = RWKV(model=model_path, strategy=strategy)

self.tokenizer = None
self.model_path = model_path
Expand Down
Loading