Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the run functions in class RWKV_RNN to forward? #1

Open
momocoQAQ opened this issue Oct 21, 2024 · 4 comments
Open

How to change the run functions in class RWKV_RNN to forward? #1

momocoQAQ opened this issue Oct 21, 2024 · 4 comments

Comments

@momocoQAQ
Copy link

May I ask how you changed the run in the class RWKV_RNN to make the state input and output? Now my revised speed after modification is relatively slow, and the converted onnx model is relatively large and the generated effect is always repeated.

@ZTMIDGO
Copy link
Owner

ZTMIDGO commented Oct 21, 2024

Do you know java and python? If you know python, you can refer to the python code of rwkv music, and then use java to implement it. For the repetition you mentioned above, you can provide an audio for me to listen to. It may be a problem with the model.

@momocoQAQ
Copy link
Author

Do you know java and python? If you know python, you can refer to the python code of rwkv music, and then use java to implement it. For the repetition you mentioned above, you can provide an audio for me to listen to. It may be a problem with the model.

Thank you very much for your reply. I found the repeated problem and solved it. The reason is that I put the returned states self.xx, self.aa, self.bb, self.xx, self.pp in the wrong order in instate. I used python to reference the music of rwkv for modification, and converted to onnx model and used java for Android deployment reasoning.

However, the onnx model I transferred now is large with 450M+, but I see that your model is only 200M+. Is this an operation such as pruning or quantization of the onnx model, or is it directly converted to 200M+ without any operation?

@ZTMIDGO
Copy link
Owner

ZTMIDGO commented Oct 22, 2024

It's been so long that I don't remember how I converted the model in the first place, it seems like I used this project to convert the onnx https://github.com/AXKuhta/RWKV-LM/tree/onnx

@momocoQAQ
Copy link
Author

It's been so long that I don't remember how I converted the model in the first place, it seems like I used this project to convert the onnx https://github.com/AXKuhta/RWKV-LM/tree/onnx

It's ok, thank you very much for your reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants