rwkv.cpp python38 compatibility
This commit is contained in:
parent
26b30f0dbe
commit
82c9825da8
4
backend-python/rwkv_pip/cpp/model.py
vendored
4
backend-python/rwkv_pip/cpp/model.py
vendored
@ -1,4 +1,4 @@
|
|||||||
from typing import Any, List
|
from typing import Any, List, Union
|
||||||
from . import rwkv_cpp_model
|
from . import rwkv_cpp_model
|
||||||
from . import rwkv_cpp_shared_library
|
from . import rwkv_cpp_shared_library
|
||||||
|
|
||||||
@ -10,5 +10,5 @@ class RWKV:
|
|||||||
self.w = {} # fake weight
|
self.w = {} # fake weight
|
||||||
self.w["emb.weight"] = [0] * self.model.n_vocab
|
self.w["emb.weight"] = [0] * self.model.n_vocab
|
||||||
|
|
||||||
def forward(self, tokens: List[int], state: Any | None):
|
def forward(self, tokens: List[int], state: Union[Any, None] = None):
|
||||||
return self.model.eval_sequence_in_chunks(tokens, state, use_numpy=True)
|
return self.model.eval_sequence_in_chunks(tokens, state, use_numpy=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user