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

How to use inference mode of ASMv2 (llama.cpp)? #24

Open
sailfish009 opened this issue Aug 28, 2024 · 1 comment
Open

How to use inference mode of ASMv2 (llama.cpp)? #24

sailfish009 opened this issue Aug 28, 2024 · 1 comment

Comments

@sailfish009
Copy link

sailfish009 commented Aug 28, 2024

The GPU memory consumption of the model was too high, so I converted it to a LLAMA.CPP file. The GPU memory usage is fine.
However, due to the nature of the model converted to llama.cpp in the model inference step, we need to convert the input parameter format. If there are any llama.cpp experts, we would appreciate it if you could tell us how to convert it.

        # all-seeing/all-seeing-v2/llava/eval/model_vqa_loader_vocab_rank.py line 156 :
        # model ( == ASMv2.gguf )
        # Below are the source code locations that need to be converted
        with torch.inference_mode():
            logits = model(
                input_ids=input_ids,
                attention_mask=attention_mask,
                images=image_tensor.to(dtype=torch.float16, device=args.device, non_blocking=True),
            ).logits
@sailfish009
Copy link
Author

Using the example provided by llama.cpp, I'm done verifying that the model performs the behavior I want.
However, I'm not going to change the issue to solved in case you have more official answers.

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

1 participant