BlinkDL / RWKV-LM

RWKV is an RNN with transformer-level LLM performance. It can be directly trained like a GPT (parallelizable). So it's combining the best of RNN and transformer - great performance, fast inference, saves VRAM, fast training, "infinite" ctx_len, and free sentence embedding.
Apache License 2.0
11.99k stars 825 forks source link

'types.SimpleNamespace' object has no attribute 'time_first' #219

Open legends-7 opened 5 months ago

legends-7 commented 5 months ago

大佬,我用v5版本的训练跑了一个小模型出来,发现v5文件夹下没有推理的代码,就用v4neo的代码和chatrwkv的chat代码试了一下,发现报错这些信息 Loading...

RWKV_HEAD_QK_DIM 0 RWKV_JIT_ON 1

loading... /workspace/RWKV-LM/RWKV-v5/model/0.1-1/rwkv-50 emb.weight float16 cpu blocks.0.ln1.weight float16 cuda:0 blocks.0.ln1.bias float16 cuda:0 blocks.0.ln2.weight float16 cuda:0 blocks.0.ln2.bias float16 cuda:0 blocks.0.ln0.weight float16 cuda:0 blocks.0.ln0.bias float16 cuda:0 blocks.0.att.time_mix_k float16 cuda:0 blocks.0.att.time_mix_v float16 cuda:0 blocks.0.att.time_mix_r float16 cuda:0 blocks.0.att.time_mix_g float16 cuda:0 blocks.0.att.time_decay float32 cuda:0 blocks.0.att.time_faaaa float16 cuda:0 blocks.0.att.receptance.weight float16 cuda:0 blocks.0.att.key.weight float16 cuda:0 blocks.0.att.value.weight float16 cuda:0 blocks.0.att.output.weight float16 cuda:0 blocks.0.att.gate.weight float16 cuda:0 blocks.0.att.ln_x.weight float16 cuda:0 blocks.0.att.ln_x.bias float16 cuda:0 blocks.0.ffn.time_mix_k float16 cuda:0 blocks.0.ffn.time_mix_r float16 cuda:0 blocks.0.ffn.key.weight float16 cuda:0 blocks.0.ffn.receptance.weight float16 cuda:0 blocks.0.ffn.value.weight float16 cuda:0 .................................................................................................................................................................................................................................................. ln_out.weight float16 cuda:0 ln_out.bias float16 cuda:0 head.weight float16 cuda:0

Run prompt... Traceback (most recent call last): File "chat.py", line 182, in out = run_rnn(tokenizer.tokenizer.encode(init_prompt)) File "chat.py", line 152, in run_rnn current_state = model.forward(model_tokens, current_state, preprocess_only = True) File "/workspace/RWKV-LM/RWKV-v4neo/src/model_run.py", line 220, in forward ww.time_mix_k, ww.time_mix_v, ww.time_mix_r, ww.time_first, ww.time_decay, AttributeError: 'types.SimpleNamespace' object has no attribute 'time_first

是我的模型有问题还是推理代码没更新吗?

BlinkDL commented 5 months ago

use https://pypi.org/project/rwkv/