Add --rwkv-strategy parameter
This commit is contained in:
parent
99dc95e14e
commit
a2a3e8f797
2 changed files with 5 additions and 1 deletions
|
@ -25,7 +25,10 @@ class RWKVModel:
|
|||
def from_pretrained(self, path, dtype="fp16", device="cuda"):
|
||||
tokenizer_path = Path(f"{path.parent}/20B_tokenizer.json")
|
||||
|
||||
model = RWKV(model=os.path.abspath(path), strategy=f'{device} {dtype}')
|
||||
if shared.args.rwkv_strategy is None:
|
||||
model = RWKV(model=os.path.abspath(path), strategy=f'{device} {dtype}')
|
||||
else:
|
||||
model = RWKV(model=os.path.abspath(path), strategy=shared.args.rwkv_strategy)
|
||||
pipeline = PIPELINE(model, os.path.abspath(tokenizer_path))
|
||||
|
||||
result = self()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue