Skip to content

Commit

Permalink
[Feature]: To be compatible with the latest version of MiniGPT-4 (#539)
Browse files Browse the repository at this point in the history
* [Feature]: To be compatible with the latest version of MiniGPT-4

* [Feature]: User try and except

Co-authored-by: Fengzhe Zhou <[email protected]>

* [Fix]: Fix lint

---------

Co-authored-by: bensenliu <[email protected]>
Co-authored-by: Fengzhe Zhou <[email protected]>
  • Loading branch information
3 people authored Nov 4, 2023
1 parent f25a980 commit 6e31520
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion opencompass/multimodal/models/minigpt_4/minigpt_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ def load_package():
current_folder_path = os.path.dirname(current_file_path)

sys.path.append(os.path.join(current_folder_path, 'MiniGPT-4')) # noqa
from minigpt4.models.mini_gpt4 import MiniGPT4

try:
# the latest version of MiniGPT4
from minigpt4.models.minigpt4 import MiniGPT4
except ImportError:
# the old version of MiniGPT4
from minigpt4.models.mini_gpt4 import MiniGPT4

sys.path.pop(-1)

Expand Down

0 comments on commit 6e31520

Please sign in to comment.