mirror of
https://github.com/deepseek-ai/DeepSeek-VL2.git
synced 2026-11-05 01:07:23 +00:00
[GH-ISSUE #101] AttributeError: 'DeepseekVLV2ForCausalLM' object has no attribute 'language_model' #83
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepSeek-VL2#83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JhyOnya on GitHub (Feb 25, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-VL2/issues/101
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 commented on GitHub (Feb 27, 2025):
try this
outputs = vl_gpt.language.generate(...)@JhyOnya commented on GitHub (Feb 27, 2025):
Thanks, it works. Besides, I find that
vl_gpt.generateis also works... I don't know why but it just works...hhh@HG731GZ commented on GitHub (Mar 24, 2025):
I met this problem too, and i tried
get an error : name 'self' is not defined, i run it in jupyter notebook.
But when i delete 'self' and re-run, it works, i dont know why, it's wierd and makes me worried.
@extraordinary126 commented on GitHub (Mar 27, 2025):
It's my mistake, the 'self' is there because I integrated this method into a class. You can remove 'self'.
@orzgugu commented on GitHub (Apr 2, 2025):
Hello, have you encountered this problem, that is, deepseek-vl2-tiny can run normally, but deepseek-vl2-small and deepseek-vl2 output the input prompt?
@changganyin commented on GitHub (Apr 22, 2025):
@orzgugu I have encountered the same problem, try to remove "<|ref|>" and "<|/ref|>" in "content". This worked for me. Hope this can help you. : )