Skip to main content

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 

EOS_INDEX = 65535
# download models: to be announced
model = RWKV_X(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


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.1.tar.gz (393.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rwkv_emb-0.0.1-py3-none-any.whl (392.9 kB view details)

Uploaded Python 3

File details

Details for the file rwkv_emb-0.0.1.tar.gz.

File metadata

  • Download URL: rwkv_emb-0.0.1.tar.gz
  • Upload date:
  • Size: 393.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rwkv_emb-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ecb86cdc5f73b1f6e9a383cb5854a12acf45e4eccd3e270189140e68480dfe9a
MD5 1074ab443f0fc91d66e5b106da2c8aec
BLAKE2b-256 151d8e3276cdb302580bcdca6a4bb256bc8acee91362581ba7a22e6970ca1c94

See more details on using hashes here.

File details

Details for the file rwkv_emb-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: rwkv_emb-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 392.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rwkv_emb-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c9530cb826a100365538c5dc132ebb52dbd9de0d1ae10a780f0a9562bce205d
MD5 47c03f61f3486880e3a82f5c1d1431e1
BLAKE2b-256 bc758d774a8a69502f63c0c89cbab9a635626ac7873c2d5a7c6cb8f933b07c40

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page