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

AttributeError: 'DeepseekVLV2ForCausalLM' object has no attribute 'language_model' #101

Open
JhyOnya opened this issue Feb 25, 2025 · 2 comments

Comments

@JhyOnya
Copy link

JhyOnya commented Feb 25, 2025

AttributeError Traceback (most recent call last)
Cell In[2], line 13
10 inputs_embeds = vl_gpt.prepare_inputs_embeds(**prepare_inputs)
12 # run the model to get the response
---> 13 outputs = vl_gpt.language_model.generate(
14 inputs_embeds=inputs_embeds,
15 attention_mask=prepare_inputs.attention_mask,
16 pad_token_id=tokenizer.eos_token_id,
17 bos_token_id=tokenizer.bos_token_id,
18 eos_token_id=tokenizer.eos_token_id,
19 max_new_tokens=512,
20 do_sample=False,
21 use_cache=True
22 )
24 answer = tokenizer.decode(outputs[0].cpu().tolist(), skip_special_tokens=True)
25 print(f"{prepare_inputs['sft_format'][0]}", answer)

File ~/.conda/envs/jhy_ds/lib/python3.10/site-packages/torch/nn/modules/module.py:1614, in Module.getattr(self, name)
1612 if name in modules:
1613 return modules[name]
-> 1614 raise AttributeError("'{}' object has no attribute '{}'".format(
1615 type(self).name, name))

AttributeError: 'DeepseekVLV2ForCausalLM' object has no attribute 'language_model'

@extraordinary126
Copy link

try this
outputs = self.vl_gpt.language.generate(...)

@JhyOnya
Copy link
Author

JhyOnya commented Feb 27, 2025

try this outputs = self.vl_gpt.language.generate(...)

Thanks, it works. Besides, I find that vl_gpt.generate is also works... I don't know why but it just works...hhh

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