Skip to content

Commit

Permalink
[Feature]: User try and except
Browse files Browse the repository at this point in the history
Co-authored-by: Fengzhe Zhou <[email protected]>
  • Loading branch information
YuanLiuuuuuu and Leymore authored Nov 4, 2023
1 parent ddd684c commit b5da708
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions opencompass/multimodal/models/minigpt_4/minigpt_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ def load_package():
current_folder_path = os.path.dirname(current_file_path)

sys.path.append(os.path.join(current_folder_path, 'MiniGPT-4')) # noqa
# to be compatible with the latest version
# if you are using the old version, please use the following line
# 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
rom minigpt4.models.mini_gpt4 import MiniGPT4

sys.path.pop(-1)

Expand Down

0 comments on commit b5da708

Please sign in to comment.