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

Great work! Can I know if there is any implementation or script to call this model? Thanks. #1

Closed
WilTay1 opened this issue Sep 27, 2023 · 2 comments

Comments

@WilTay1
Copy link

WilTay1 commented Sep 27, 2023

No description provided.

@Edward-Sun
Copy link
Collaborator

Edward-Sun commented Sep 27, 2023

Hi, thanks for your interest in our work. We are still working on code cleaning.

For now, you can install the LLaVA repo and use this gist to replace the model/builder.py file in llava.

Then, you can call the LLaVA-RLHF model by:

load_bf16 = True

tokenizer, model, image_processor, context_len = load_pretrained_model(
    model_path, None, model_name, load_bf16=load_bf16)

model = PeftModel.from_pretrained(
      model,
      lora_path,
)

And remember to convert the input image to torch.bfloat16

images = images.to(dtype=torch.bfloat16)

@barshag
Copy link

barshag commented Oct 5, 2023

So after replacing the gist, it will work straight-forward with the GRADIO? (Where should i write the code above?)

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

3 participants