-
Notifications
You must be signed in to change notification settings - Fork 199
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
Enable LLaVa-1.5 in VLM Pipeline #917
Merged
andrei-kochin
merged 20 commits into
openvinotoolkit:master
from
yatarkan:yt/add-llava-1-5
Oct 11, 2024
Merged
Changes from 16 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
3bc9163
Add model type to vlm config
yatarkan 8701288
Add llava specific config params to processor config
yatarkan 5b4f145
Add model type to vision encoder, separate encode methods for llava a…
yatarkan be3fab4
Enable llava model in vlm pipeline, separate preparing inputs embeds …
yatarkan 2ec5ef8
Add test for vlm sample with llava model
yatarkan 49447b9
Restore function for merging text and image embeds for llava
yatarkan 790981f
Move getting input embeds for minicpm to separate method
yatarkan 1b5435c
Add vlm model type enum class
yatarkan 6ccfce4
Merge branch 'master' into yt/add-llava-1-5
yatarkan 8912b56
Fix typo in minicpm model type
yatarkan bc643e1
Merge branch 'master' into yt/add-llava-1-5
yatarkan 304f6ed
Merge branch 'master' into yt/add-llava-1-5
ilya-lavrenov cdff0c1
Merge branch 'master' into yt/add-llava-1-5
yatarkan 729b063
Add llava to supported models
yatarkan 18b49c7
Switch to optimum-intel from git in requirements
yatarkan 4592cd6
Remove redundant optimum install
yatarkan 8f30428
Reorder supported vlm models
yatarkan 04a0014
Reuse m_vision_encoder
yatarkan d9feaea
Fix samples requirements with lowering numpy for macos
yatarkan 8f1e347
Fix python tests requirements with numpy for macos
yatarkan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (C) 2023-2024 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
#include <unordered_map> | ||
|
||
#include "openvino/genai/visibility.hpp" | ||
#include <openvino/core/except.hpp> | ||
|
||
namespace ov::genai { | ||
|
||
enum class OPENVINO_GENAI_EXPORTS VLMModelType { | ||
MINICPM, | ||
LLAVA, | ||
}; | ||
|
||
inline VLMModelType to_vlm_model_type(const std::string& value) { | ||
static const std::unordered_map<std::string, VLMModelType> model_types_map = { | ||
{"minicpmv", VLMModelType::MINICPM}, | ||
{"llava", VLMModelType::LLAVA} | ||
}; | ||
|
||
auto it = model_types_map.find(value); | ||
if (it != model_types_map.end()) { | ||
return it->second; | ||
} | ||
OPENVINO_THROW("Unsupported '", value, "' VLM model type"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we define base class for VisionEncoder ? and create inherited classes for MiniCPM and LLava specifically
In this case, we don't need to put all the fields for different models into common class. Similarly, processor config can be model specific class.