add WebGPU Python Mode (https://github.com/cryscan/web-rwkv-py)
This commit is contained in:
2
backend-python/rwkv_pip/utils.py
vendored
2
backend-python/rwkv_pip/utils.py
vendored
@@ -84,6 +84,8 @@ class PIPELINE:
|
||||
return e / e.sum(axis=axis, keepdims=True)
|
||||
|
||||
def sample_logits(self, logits, temperature=1.0, top_p=0.85, top_k=0):
|
||||
if type(logits) == list:
|
||||
logits = np.array(logits)
|
||||
np_logits = type(logits) == np.ndarray
|
||||
if np_logits:
|
||||
probs = self.np_softmax(logits, axis=-1)
|
||||
|
||||
Reference in New Issue
Block a user