From 87c83eae51a5f3b8709f6e4d56104687ba126735 Mon Sep 17 00:00:00 2001 From: Vandivier Date: Sat, 22 Apr 2023 17:11:05 -0600 Subject: [PATCH 1/3] chore: m2 installable --- environment.yml | 5 ++--- minigpt4/datasets/data_utils.py | 12 ++---------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/environment.yml b/environment.yml index d5cfcf8..be76432 100644 --- a/environment.yml +++ b/environment.yml @@ -3,12 +3,11 @@ channels: - pytorch - defaults - anaconda + - conda-forge dependencies: - python=3.9 - - cudatoolkit - pip - pytorch=1.12.1 - - pytorch-mutex=1.0=cuda - torchaudio=0.12.1 - torchvision=0.13.1 - pip: @@ -30,6 +29,7 @@ dependencies: - kiwisolver==1.4.4 - matplotlib==3.7.0 - multidict==6.0.4 + - numpy - openai==0.27.0 - packaging==23.0 - psutil==5.9.4 @@ -51,7 +51,6 @@ dependencies: - omegaconf==2.3.0 - opencv-python==4.7.0.72 - iopath==0.1.10 - - decord==0.6.0 - tenacity==8.2.2 - peft - pycocoevalcap diff --git a/minigpt4/datasets/data_utils.py b/minigpt4/datasets/data_utils.py index cf6497f..79c0295 100644 --- a/minigpt4/datasets/data_utils.py +++ b/minigpt4/datasets/data_utils.py @@ -5,20 +5,12 @@ For full license text, see the LICENSE_Lavis file in the repo root or https://opensource.org/licenses/BSD-3-Clause """ -import gzip import logging -import os -import random as rnd -import tarfile -import zipfile import random from typing import List -from tqdm import tqdm -import decord -from decord import VideoReader +# import decord import webdataset as wds -import numpy as np import torch from torch.utils.data.dataset import IterableDataset @@ -26,7 +18,7 @@ from minigpt4.common.registry import registry from minigpt4.datasets.datasets.base_dataset import ConcatDataset -decord.bridge.set_bridge("torch") +# decord.bridge.set_bridge("torch") MAX_INT = registry.get("MAX_INT") From 3ca6fff1156650231520fa004abca75c73d2f4b0 Mon Sep 17 00:00:00 2001 From: Vandivier Date: Sat, 22 Apr 2023 17:11:12 -0600 Subject: [PATCH 2/3] ignore pyc --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9a4d72b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +**.pyc \ No newline at end of file From fb7dd787f9fa63c58d03f526a269f6a9d51a1203 Mon Sep 17 00:00:00 2001 From: Vandivier Date: Sun, 23 Apr 2023 15:03:55 -0600 Subject: [PATCH 3/3] fix: maybe cpu mode --- demo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo.py b/demo.py index b3659f1..7ee1f73 100644 --- a/demo.py +++ b/demo.py @@ -57,11 +57,11 @@ cfg = Config(args) model_config = cfg.model_cfg model_config.device_8bit = args.gpu_id model_cls = registry.get_model_class(model_config.arch) -model = model_cls.from_config(model_config).to('cuda:{}'.format(args.gpu_id)) +model = model_cls.from_config(model_config).to('cpu') vis_processor_cfg = cfg.datasets_cfg.cc_sbu_align.vis_processor.train vis_processor = registry.get_processor_class(vis_processor_cfg.name).from_config(vis_processor_cfg) -chat = Chat(model, vis_processor, device='cuda:{}'.format(args.gpu_id)) +chat = Chat(model, vis_processor, device='cpu') print('Initialization Finished') # ========================================