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

[BUG] TypeError: cannot assign 'tuple' as child module 'llm_past_key_values' (torch.nn.Module or None expected) #797

Open
2 tasks done
JACKYLUO1991 opened this issue Jan 24, 2025 · 1 comment
Assignees

Comments

@JACKYLUO1991
Copy link

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

  • 我已经搜索过已有的issues和讨论 | I have searched the existing issues / discussions

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

  • 我已经搜索过FAQ | I have searched FAQ

当前行为 | Current Behavior

File "/Data1/home/MiniCPM-o/web_demos/minicpm-o_2.6/model_server.py", line 475, in prefill
res = self.minicpmo_model.streaming_prefill(
File "/Data1/home/.conda/envs/minicpmo/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/Data1/home/.cache/huggingface/modules/transformers_modules/minicpmo_2_6_lora_sft/modeling_minicpmo.py", line 1158, in streaming_prefill
self.llm_past_key_values = outputs["past_key_values"]
File "/Data1/home/l.conda/envs/minicpmo/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in setattr
raise TypeError(f"cannot assign '{torch.typename(value)}' as child module '{name}' "
TypeError: cannot assign 'tuple' as child module 'llm_past_key_values' (torch.nn.Module or None expected)

当运行视频问答功能时候,显示以上错误代码。如何解决呢?

期望行为 | Expected Behavior

No response

复现方法 | Steps To Reproduce

No response

运行环境 | Environment

- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):

备注 | Anything else?

No response

@iceflame89
Copy link
Collaborator

iceflame89 commented Feb 6, 2025

请确认transformers版本为4.44.2, 并确保你的minicpmo_2_6_lora_sft目录下的代码与huggingface MiniCPM-o-2_6一致。

@iceflame89 iceflame89 changed the title [BUG] <title> [BUG] TypeError: cannot assign 'tuple' as child module 'llm_past_key_values' (torch.nn.Module or None expected) Feb 6, 2025
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