The EmbeddingRWKV Model
Project description
The RWKV-X Language Model
https://github.com/howard-hou/EmbeddingRWKV
# !!! set these before import RWKV !!!
import os
os.environ["RWKV_CUDA_ON"] = '0' # '1' to compile CUDA kernel (10x faster), requires c++ compiler & cuda libraries
from rwkv_emb import EmbeddingRWKV
EOS_INDEX = 65535
# download models: to be announced
model = EmbeddingRWKV(model_path='path-to-model', strategy='cpu fp32')
# !!! model.forward(tokens, state) will modify state in-place !!!
emb, state = model.forward([187, 510, 1563, 310, 247, EOS_INDEX], None)
print(emb.detach().cpu().numpy()) # get logits
emb, state = model.forward([187, 510], None)
emb, state = model.forward([1563], state) # RNN has state (use deepcopy to clone states)
emb, state = model.forward([310, 247, EOS_INDEX], state)
print(emb.detach().cpu().numpy()) # same result as above
print('\n')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rwkv_emb-0.0.2.tar.gz
(393.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
rwkv_emb-0.0.2-py3-none-any.whl
(392.9 kB
view details)
File details
Details for the file rwkv_emb-0.0.2.tar.gz.
File metadata
- Download URL: rwkv_emb-0.0.2.tar.gz
- Upload date:
- Size: 393.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc6353674b0ad52be1be59dee4f034c1a5076a9108ee2ecc3e40bc9784b6c75b
|
|
| MD5 |
aac356980f983724420c32c7d44c429b
|
|
| BLAKE2b-256 |
9409754652a5df0b9218e0a696a3eaeb43ab844d54edd289045abeda8ce273a3
|
File details
Details for the file rwkv_emb-0.0.2-py3-none-any.whl.
File metadata
- Download URL: rwkv_emb-0.0.2-py3-none-any.whl
- Upload date:
- Size: 392.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9319abefbd60c0ef57ae5eb95985fe167377c23f518dbbf0b323500123c3055d
|
|
| MD5 |
33f00fb9fa677d90ee034a550f93e944
|
|
| BLAKE2b-256 |
65251eb1019c7f8626c0a7156a0ebfbbfaee0a77cff9ec78abb7f12faec85226
|