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

[Docs] import错误 #886

Open
Newbie-pz opened this issue Feb 6, 2025 · 3 comments
Open

[Docs] import错误 #886

Newbie-pz opened this issue Feb 6, 2025 · 3 comments

Comments

@Newbie-pz
Copy link

📚 The doc issue

Image

新年快乐!我想问一下为什么这部分代码在调用父类包的时候出现了错误 我给每个项目都添加了--init--.py但仍然不管用
包括from .conversation import get_conv_template这句改为from ...conversation import get_conv_template依旧出错

Suggest a potential alternative/fix

No response

@yuecao0119
Copy link
Collaborator

你好,

看起来是你的导包路径相对关系不太对,如果是以当前文件为依据,应该是上级目录,用..,或者可以参考我们代码里的导入方式

from internvl.conversation import get_conv_template
from internvl.model.internlm2.modeling_internlm2 import InternLM2ForCausalLM
from internvl.model.phi3.modeling_phi3 import Phi3ForCausalLM

@Newbie-pz
Copy link
Author

您好我在最开始是用的就是您的导入方式,但是代码发生了同样的报错

@yuecao0119
Copy link
Collaborator

可以发一下你的执行命令吗?

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