FlagAI icon indicating copy to clipboard operation
FlagAI copied to clipboard

[Question]: Autoloader可以优先找本地的模型数据而不是先去model hub找模型吗?

Open luentong opened this issue 1 year ago • 4 comments

Description

如题,非公网开发环境每次等autoloader去外面找有些浪费时间

Alternatives

No response

luentong avatar Jun 13 '23 07:06 luentong

他本来就是优先找本地的,但是这个模型位置代码写的很奇怪,比如你本地模型在:/data/model/aquila-7b,那么你应该写

state_dict = "/data/model"
model_name = "aquila-7b"

Louis-y-nlp avatar Jun 13 '23 07:06 Louis-y-nlp

state_dict 可以指定路径,如果已有就不会再下载了。 通常我都是在全局搞个目录,autoloader指定这么个目录。遇到新模型下载到全局目录

ftgreat avatar Jun 13 '23 08:06 ftgreat

@Louis-y-nlp @ftgreat 我这边不是全局目录 state_dict和model_name都是你们说的这样写 但是每次跑都会有 “model hub is not reachable”, 然后再从本地找的到模型,会不会改成全局目录就没有这个问题了呀

luentong avatar Jun 13 '23 08:06 luentong

https://model.baai.ac.cn/models 可以从这里选择下载。

ftgreat avatar Jun 13 '23 09:06 ftgreat

修改flagai.auto_model.auto_loader中is_exist_finetuned_model函数,直接返回raw_model_name

thisissum avatar Jun 14 '23 01:06 thisissum

@thisissum 可以了!谢谢

luentong avatar Jun 14 '23 07:06 luentong