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

from modeling_deltalm import DeltalmForConditionalGeneration报错 no known parent package #443

Open
heiheiheibj opened this issue Nov 14, 2023 · 2 comments

Comments

@heiheiheibj
Copy link

想在本地部署翻译模型,在 Fengshenbang-LM\fengshen\models\deltalm 目录下,执行的代码为官方例子
from modeling_deltalm import DeltalmForConditionalGeneration
from transformers import AutoTokenizer

model = DeltalmForConditionalGeneration.from_pretrained("IDEA-CCNL/Randeng-Deltalm-362M-Zh-En")
tokenizer = AutoTokenizer.from_pretrained("microsoft/infoxlm-base")

text = "尤其在夏天,如果你决定徒步穿越雨林,就需要小心蚊子。"

inputs = tokenizer(text, max_length=512, return_tensors="pt")

generate_ids = model.generate(inputs["input_ids"], max_length=512)
tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]

from modeling_deltalm import DeltalmForConditionalGeneration报错
ImportError: attempted relative import with no known parent package

image

谢谢

@ganzhiruyi
Copy link
Contributor

pip install -e . 先安装下试试

@Evilran
Copy link

Evilran commented Jan 16, 2024

Randeng-Deltalm-362M-En-Zh 不是 Randeng-Deltalm-362M-En-Zn

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

3 participants