forked from camenduru/minigpt4
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.bat
62 lines (51 loc) · 1.87 KB
/
setup.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@echo off
set PYTHON_VER=3.10.11
:: Check if Python version meets the recommended version
python --version 2>nul | findstr /b /c:"Python %PYTHON_VER%" >nul
if errorlevel 1 (
echo Warning: Python version %PYTHON_VER% is recommended.
)
IF NOT EXIST venv (
echo Creating venv...
python -m venv venv
)
:: Deactivate the virtual environment
call .\venv\Scripts\deactivate.bat
:: Activate the virtual environment
call .\venv\Scripts\activate.bat
echo Installing Torch and torchvision...
pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --index-url https://download.pytorch.org/whl/cu118
echo Cloning and installing bitsandbytes-windows...
git clone https://github.com/Keith-Hon/bitsandbytes-windows.git
cd bitsandbytes-windows
pip3 install -e .
cd ..
echo Downloading pretrained models...
curl -L -o ./checkpoint.pth https://huggingface.co/ckpt/minigpt4-7B/resolve/main/prerained_minigpt4_7b.pth
curl -L -o ./blip2_pretrained_flant5xxl.pth https://huggingface.co/ckpt/minigpt4/resolve/main/blip2_pretrained_flant5xxl.pth
curl -L -o ./models.zip https://huggingface.co/pipyp/minigpt4py/resolve/main/models.zip
python extract.py
echo Installing cmake, lit, salesforce-lavis, accelerate, and transformers...
pip install cmake
pip install lit
pip install -q salesforce-lavis
pip install -q accelerate
pip install -q git+https://github.com/huggingface/transformers.git -U
:: Adding the extra required libraries...
echo Installing argparse, csv, os, random, glob, time, numpy, Pillow, cv2, tqdm, tensorflow, huggingface-hub, pathlib, copy, and keras...
pip install argparse
pip install csv
pip install os
pip install random
pip install glob
pip install time
pip install numpy
pip install Pillow
pip install opencv-python-headless
pip install tqdm
pip install tensorflow
pip install huggingface-hub
pip install pathlib
pip install copy
pip install keras
echo Setup complete within virtual environment!