Skip to content

为什么使用huggingface上面的代码,老是说识别不了这个model type tinyllava #162

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

Open
MichealZhangxa opened this issue Dec 23, 2024 · 20 comments

Comments

@MichealZhangxa
Copy link

9
使用不了Zhang199/TinyLLaVA-Qwen2-0.5B-SigLIP,但是能使用tinyllava/TinyLLaVA-Phi-2-SigLIP-3.1B,transformer库升级也没用

@ZhangXJ199
Copy link
Collaborator

使用load_model.py中的load_pretrained_model函数加载试试

@MichealZhangxa
Copy link
Author

使用load_model.py中的load_pretrained_model函数加载试试

还是不行

@MichealZhangxa
Copy link
Author

MichealZhangxa commented Dec 23, 2024

使用load_model.py中的load_pretrained_model函数加载试试

而且很奇怪的一点是我明明给的是从huggingface上面下载下来的本地路径,也设置了 model = TinyLlavaForConditionalGeneration.from_pretrained(model_name_or_path, local_files_only=True, # 仅使用本地文件
low_cpu_mem_usage=True, resume_download=True)还是会从huggingface上面下载,而我的linux子系统不能访问huggingface

@ZhangXJ199
Copy link
Collaborator

应该是环境问题 重新执行pip install -e .之后试一下

@MichealZhangxa
Copy link
Author

应该是环境问题 重新执行pip install -e .之后试一下

麻烦请问可以提供一下你的模型结构吗,可以打印一下吗,我实在是跑不通

@MichealZhangxa
Copy link
Author

应该是环境问题 重新执行pip install -e .之后试一下
目前几个人都没跑通这个代码,麻烦作者可以提供一下参数吗

@Camellia-hz
Copy link

@MichealZhangxa 你好,请问您解决这个load本地模型的问题了吗?

@MichealZhangxa
Copy link
Author

@MichealZhangxa 你好,请问您解决这个load本地模型的问题了吗?

没有,解决了麻烦告诉我一下

@depixels
Copy link

depixels commented Mar 6, 2025

在权重文件夹下加入config.json内加入 "auto_map": {
"AutoConfig": "configuration.TinyLlavaConfig",
"AutoModelForCausalLM": "modeling_tinyllava_phi.TinyLlavaForConditionalGeneration"
},

@ZhihuaGao
Copy link

ZhihuaGao commented Mar 26, 2025

@ZhangXJ199
您好这个问题一直没有解决,有什么解决方案嘛

@ZhangXJ199
Copy link
Collaborator

把AutoModel加载换成load_pretrained_model函数中的TinyLlavaForConditionalGeneration.from_pretrained加载

@MichealZhangxa
Copy link
Author

MichealZhangxa commented Mar 26, 2025 via email

@ZhangXJ199
Copy link
Collaborator

把模型下载到本地再试试 把HF路径改为绝对路径

@ZhihuaGao
Copy link

@ZhangXJ199
经过验证,下载到的本地模型只有TinyLLaVA-Phi-2-SigLIP-3.1B不会出现这个错误,其他两个我尝试的都会有这个问题

Image 通过对比发现inyLLaVA-Phi-2-SigLIP-3.1B的config.json中会多出这个配置,请问是什么原因造成的啊,该如何解决啊,而且是利用你们的代码自己训练得到的模型也有同样的问题 Image

@ZhangXJ199
Copy link
Collaborator

Image
我们按照readme中的测试方法,无论phi还是qwen都没有出现以上问题

@ZhihuaGao
Copy link

ZhihuaGao commented Mar 26, 2025

@ZhangXJ199
Image
这个是你们提供测试的代码,主要是你们提供的custom_fintune的代码也是这种调用方式,导致无法微调

@ZhangXJ199
Copy link
Collaborator

是的,TinyLLaVA-Phi-2-SigLIP-3.1B是我们发布的初代模型,其中含有modeling_tinyllava_phi.py文件,且config.json文件中含有auto_map,可以依托transformer进行加载。
后续发布的qwen模型中,我们没有提供如modeling_tinyllava_phi.py的映射文件,因此无法用Automodel加载,但是使用TinyLlavaForConditionalGeneration.from_pretrained加载没有问题。

@ZhihuaGao
Copy link

@ZhangXJ199 好嘞谢谢我试试

@ha1ha2hahaha
Copy link

能请问下,TinyLlavaForConditionalGeneration.from_pretrained这里没有chat函数,怎么解决呢 @ZhihuaGao @ZhangXJ199

@ZhangXJ199
Copy link
Collaborator

可以使用generate函数进行inference

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

6 participants