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

Doesn't seem to obey --path argument, instead try to download to .cache again #20

Open
hsaito opened this issue Feb 21, 2023 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@hsaito
Copy link

hsaito commented Feb 21, 2023

On Windows at least, it seems to be path is not obeyed and kept downloading into .cache directory of the c:\ file system (which I don't have enough space.)

I've manually downloaded required files into other drive, where the relative path is ../models--facebook--opt-30b

Executing python -m flexgen.flex_opt --model facebook/opt-30b --path ../models--facebook--opt-30b still causes it to download the item into aforementioned .cache directory -- tried other variant python -m flexgen.flex_opt --model facebook/opt-30b --path ../models--facebook--opt-30b/snapshots/ceea0a90ac0f6fae7c2c34bcb40477438c152546.

Am I misunderstanding the way --path work or there's something wrong with it?

Also it would be nice to have the option to inhibit all the automatic download and just stop with error as I do not want to exhaust disk space that's already precious...

@Ying1123
Copy link
Collaborator

Before the argument --path works, FlexGen will download weights by using huggingface/transformers, which will use .cache by default. Then FlexGen converts the huggingface format to its own format.

The weight download function is here.
https://github.com/Ying1123/FlexGen-dev/blob/876fff7d33caecca5c972efcf5028fe6250ceeae/flexgen/flex_opt.py#L641-L642
If you are familiar with how huggingface/transformers work, you can modify it for your needs.

@freedmand
Copy link

You can modify where the transformers module places cached files by setting the environment variable TRANSFORMERS_CACHE. See here for additional information: https://stackoverflow.com/questions/63312859/how-to-change-huggingface-transformers-default-cache-directory

@Yang-HangWA
Copy link

Yang-HangWA commented Feb 24, 2023

@Ying1123 Hi, I have the same confusion when I downloaded the model of facebook/opt-30b from huggingface, and the model files can't be recognized by transformers==4.25.1, so is there a way to use local weights?
image

image

@Ying1123 Ying1123 added the help wanted Extra attention is needed label Feb 26, 2023
@Vinkle-hzt
Copy link

@hsaito PR #111 allows to use --local argument to load manually downloaded model, you can have a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants