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

update readme file (adding usage of HuggingFace model) #413

Merged
merged 3 commits into from
Nov 4, 2023

Conversation

mao-code
Copy link
Contributor

@mao-code mao-code commented Sep 1, 2023

Based on this issue
I found that the contents of documents that describe the usage of LLaVA series model via HuggingFace are not that clear.
Therefore, I would like to add these information directly in the readme file. Hope that it can help someone who struggle with it.
If there are any mistakes, please correct me!
Thanks!

@mao-code mao-code closed this Sep 1, 2023
@mao-code mao-code deleted the feature/update-readme-usage branch September 1, 2023 16:49
@mao-code mao-code restored the feature/update-readme-usage branch September 3, 2023 07:18
@mao-code mao-code reopened this Sep 3, 2023
@wm-mask
Copy link

wm-mask commented Sep 12, 2023

Thanks for the PR! I have a quick question, where do the models get saved? I can't find them. Thank you 🙏
Because in the documentation they ask to point to the ckpt using --model-path /path/to/model

python -m llava.serve.model_worker --host 0.0.0.0 --controller http://localhost:10000 --port 40000 --worker http://localhost:40000 --model-path /path/to/model

When I clone using git the huggingface repo under a folder checkpoints, I have:

❯ tree ./checkpoints
./checkpoints
└── llava-llama-2-13b-chat-lightning-preview
    ├── LICENSE
    ├── README.md
    ├── config.json
    ├── controller.log
    ├── generation_config.json
    ├── gradio_web_server.log
    ├── mm_projector.bin
    ├── pytorch_model-00001-of-00003.bin
    ├── pytorch_model-00002-of-00003.bin
    ├── pytorch_model-00003-of-00003.bin
    ├── pytorch_model.bin.index.json
    ├── special_tokens_map.json
    ├── tokenizer.model
    └── tokenizer_config.json

but no model is there, just bin files.

Then when I specify this folder in the --model-path in the command, the altter fails with:

2023-09-12 16:55:55 | ERROR | stderr |     return _sentencepiece.SentencePieceProcessor_LoadFromFile(self, arg)
2023-09-12 16:55:55 | ERROR | stderr | RuntimeError: Internal: src/sentencepiece_processor.cc(1101) [model_proto->ParseFromArray(serialized.data(), serialized.size())]

@mao-code
Copy link
Contributor Author

@wm-mask The model-path here I pass is the huggingface model path
Note that I use "load_from_pretrained" function to load models.

@wm-mask
Copy link

wm-mask commented Sep 13, 2023

@mao-code Thanks for your reply. Sorry it's not clear.
When you say it's the hugging face model path, do you pass to it just the "liuhaotian/LLaVA-Lightning-MPT-7B-preview" name of the model? or do you pass the local path to where the model is cached by huggingface?

Also when you say "load_from_pretrained" do you mean you change some function in the code somewhere? Or just to load the model the first time for huggingface to cache it?

I followed your updated README

@mao-code
Copy link
Contributor Author

@wm-mask Yes, the model path I used is just the hugging face model path. For the example model, it is just “liuhaotian/LLaVA-Lightning-MPT-7B-preview”.

And the load_from_pretrain is a function I import within this repository. I didn’t change anything.

@mao-code
Copy link
Contributor Author

@wm-mask For the second part of the content that I update in the read me file, I import the eval function as I mentioned in the readme.

By doing so, you can use it to “inference” directly using the eval function.

For more detail, you can check these functions in the repository.

@haotian-liu
Copy link
Owner

Sorry for the late response. I like the idea of adding the quick start scripts, made a few mods to the language and change it the llava-v1.5-7b model in the example. Also used the collapse toggle to avoid displaying large amount of code in README. Thank you!

@haotian-liu haotian-liu merged commit 6c5ab2e into haotian-liu:main Nov 4, 2023
choics2623 pushed a commit to choics2623/LLaVA that referenced this pull request Dec 16, 2023
…e-usage

update readme file (adding usage of HuggingFace model)
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

Successfully merging this pull request may close these issues.

3 participants