File tree Expand file tree Collapse file tree 11 files changed +144
-33
lines changed Expand file tree Collapse file tree 11 files changed +144
-33
lines changed Original file line number Diff line number Diff line change @@ -48,30 +48,46 @@ PaddleMIX是基于飞桨的多模态大模型开发套件,聚合图像、文
48
48
https://github.com/PaddlePaddle/PaddleMIX/assets/29787866/8d32722a-e307-46cb-a8c0-be8acd93d2c8
49
49
50
50
51
- ## 安装
51
+ ## 安装步骤
52
+ ### 1. 克隆PaddleMIX仓库
53
+ ```
54
+ git clone https://github.com/PaddlePaddle/PaddleMIX
55
+ cd PaddleMIX
56
+ ```
52
57
53
- 1 . 环境依赖
58
+ ### 2. 创建虚拟环境
59
+ ```
60
+ conda create -n paddlemix python=3.10 -y
61
+ conda activate paddlemix
54
62
```
55
- pip install -r requirements.txt
63
+ ### 3. 安装PaddlePaddle
64
+ #### 方法 1: 一键安装(推荐)
65
+ - CUDA 11.x或12.3
66
+ - PaddlePaddle 3.0.0b1
67
+ ```
68
+ sh build_paddle_env.sh
56
69
```
57
70
71
+ #### 方法 2: 手动安装
58
72
关于PaddlePaddle安装的详细教程请查看[ Installation] ( https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/linux-pip.html ) 。
59
73
60
- > 注:ppdiffusers部分模型需要依赖 CUDA 11.2 及以上版本,如果本地机器不符合要求,建议前往 [ AI Studio] ( https://aistudio.baidu.com/index ) 进行模型训练、推理任务。
61
74
62
- > 如果希望使用 ** bf16 ** 训练推理,请使用支持 ** bf16 ** 的GPU,如A100。
75
+ ### 4. 安装依赖
63
76
64
- 2 . 手动安装
65
- ```
66
- git clone https://github.com/PaddlePaddle/PaddleMIX
67
- cd PaddleMIX
68
- pip install -e .
77
+ #### 方法 1: 一键安装(推荐)
69
78
70
- #ppdiffusers 安装
71
- cd ppdiffusers
72
- pip install -e .
79
+ 运行以下命令来自动安装所有必要的依赖:
80
+ ```
81
+ sh build_env.sh
73
82
```
74
83
84
+ #### 方法 2: 手动安装(请参考 build_env.sh)
85
+
86
+ > 注:ppdiffusers部分模型需要依赖 CUDA 11.2 及以上版本,如果本地机器不符合要求,建议前往 [ AI Studio] ( https://aistudio.baidu.com/index ) 进行模型训练、推理任务。
87
+
88
+ > 如果希望使用** bf16** 训练推理,请使用支持** bf16** 的GPU,如A100。
89
+
90
+
75
91
## 教程
76
92
77
93
- [ 快速开始] ( applications/README.md/#快速开始 )
Original file line number Diff line number Diff line change @@ -47,29 +47,47 @@ https://github.com/PaddlePaddle/PaddleMIX/assets/29787866/8d32722a-e307-46cb-a8c
47
47
48
48
49
49
50
- ## Installation
50
+ ## Installation
51
+ ### 1. Clone the PaddleMIX repository
52
+ ```
53
+ git clone https://github.com/PaddlePaddle/PaddleMIX
54
+ cd PaddleMIX
55
+ ```
51
56
52
- 1 . Environment Dependencies
57
+ ### 2. Create a virtual environment
58
+ ```
59
+ conda create -n paddlemix python=3.10 -y
60
+ conda activate paddlemix
53
61
```
54
- pip install -r requirements.txt
62
+ ### 3. Install PaddlePaddle
63
+ #### Method 1: One-click installation (recommended)
64
+ - CUDA 11.x or 12.3
65
+ - PaddlePaddle 3.0.0b1
55
66
```
67
+ sh build_paddle_env.sh
68
+ ```
69
+
70
+ #### Method 2: Manual installation
71
+ For detailed instructions on installing PaddlePaddle, please refer to [ Installation] ( https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/linux-pip.html ) .
72
+
73
+
74
+ ### 4. Install dependencies
75
+
76
+ #### Method 1: One-click installation (recommended)
77
+
78
+ Run the following command to automatically install all necessary dependencies:
79
+ ```
80
+ sh build_env.sh
81
+ ```
82
+
83
+ #### Method 2: Manual installation (Please refer to build_env.sh)
56
84
57
85
Detailed [ installation] ( (https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/linux-pip.html) ) tutorials for PaddlePaddle
58
86
59
87
> Note: parts of Some models in ppdiffusers require CUDA 11.2 or higher. If your local machine does not meet the requirements, it is recommended to go to [ AI Studio] ( https://aistudio.baidu.com/index ) for model training and inference tasks.
60
88
61
89
> If you wish to train and infer using ** bf16** , please use a GPU that supports ** bf16** , such as the A100.
62
90
63
- 2 . Manual Installation
64
- ```
65
- git clone https://github.com/PaddlePaddle/PaddleMIX
66
- cd PaddleMIX
67
- pip install -e .
68
-
69
- #ppdiffusers 安装
70
- cd ppdiffusers
71
- pip install -e .
72
- ```
73
91
74
92
## Tutorial
75
93
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # 设置错误时退出
4
+ set -e
5
+
6
+ echo " 开始安装 PaddleMIX 及其依赖..."
7
+
8
+ # 安装 PaddleMIX
9
+ echo " 安装 PaddleMIX..."
10
+ pip install -e .
11
+
12
+ # 安装 ppdiffusers
13
+ echo " 安装 ppdiffusers..."
14
+ cd ppdiffusers
15
+ pip install -e .
16
+ cd ..
17
+
18
+ # 安装依赖包
19
+ echo " 安装依赖包..."
20
+ pip install -r requirements.txt
21
+
22
+ # 安装自定义算子
23
+ echo " 安装自定义算子..."
24
+ cd paddlemix/external_ops
25
+ python setup.py install
26
+ cd ../../
27
+
28
+ echo " 安装完成!"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # 设置错误时退出
4
+ set -e
5
+
6
+ echo " 开始安装 paddlepaddle ..."
7
+ # 检测 CUDA 版本并安装相应的 paddlepaddle
8
+ if command -v nvcc & > /dev/null; then
9
+ cuda_version=$( nvcc --version | grep " release" | sed -n ' s/.*release \([0-9]\+\.[0-9]\+\).*/\1/p' )
10
+ echo " 检测到 CUDA 版本: $cuda_version "
11
+ if [[ " $cuda_version " == " 11.2" ]]; then
12
+ echo " 安装 CUDA 11.2 版本的 paddlepaddle..."
13
+ python -m pip install paddlepaddle-gpu==3.0.0b1 -i https://www.paddlepaddle.org.cn/packages/stable/cu112/
14
+ elif [[ " $cuda_version " == " 11.6" ]]; then
15
+ echo " 安装 CUDA 11.6 版本的 paddlepaddle..."
16
+ python -m pip install paddlepaddle-gpu==3.0.0b1 -i https://www.paddlepaddle.org.cn/packages/stable/cu116/
17
+ elif [[ " $cuda_version " == " 11.7" ]]; then
18
+ echo " 安装 CUDA 11.7 版本的 paddlepaddle..."
19
+ python -m pip install paddlepaddle-gpu==3.0.0b1 -i https://www.paddlepaddle.org.cn/packages/stable/cu117/
20
+ elif [[ " $cuda_version " == " 11.8" ]]; then
21
+ echo " 安装 CUDA 11.8 版本的 paddlepaddle..."
22
+ python -m pip install paddlepaddle-gpu==3.0.0b1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
23
+ elif [[ " $cuda_version " == " 12.3" ]]; then
24
+ echo " 安装 CUDA 12.3 版本的 paddlepaddle..."
25
+ python -m pip install paddlepaddle-gpu==3.0.0b1 -i https://www.paddlepaddle.org.cn/packages/stable/cu123/
26
+ else
27
+ echo " 警告: 不支持的 CUDA 版本。请手动安装适合您系统的 paddlepaddle 版本。"
28
+ fi
29
+ else
30
+ echo " 未检测到 CUDA。安装 CPU 版本的 paddlepaddle..."
31
+ pip install paddlepaddle-gpu==3.0.0b1
32
+ fi
33
+
34
+ echo " 安装完成!"
Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ paddlenlp>=2.6.0rc0
4
4
https://bj.bcebos.com/v1/paddlenlp/models/community/paddlemix/appflow/paddlespeech/paddlespeech-0.0.1-py3-none-any.whl
5
5
opencc == 1.1.6
6
6
matplotlib == 3.7.5
7
+ scipy == 1.12.0
Original file line number Diff line number Diff line change 31
31
if version .startswith ('3' ):
32
32
from .internvl_dataset import *
33
33
else :
34
- print (f"paddlenlp version { version } is not 3.x, skipping import." )
34
+ print (f"paddlenlp version { version } is not 3.x, skipping import internvl2 datasets ." )
35
35
36
36
except ImportError :
37
37
print ("paddlenlp is not installed." )
Original file line number Diff line number Diff line change 10
10
- ** python >= 3.10**
11
11
- tiktoken
12
12
> 注:tiktoken 要求python >= 3.8
13
- - paddlepaddle-gpu > = 2.6.1
13
+ - ** paddlepaddle-gpu 要求版本develop**
14
+ ```
15
+ # 安装示例
16
+ python -m pip install paddlepaddle-gpu==0.0.0.post118 -f https://www.paddlepaddle.org.cn/whl/linux/gpu/develop.html
17
+ ```
18
+
19
+
14
20
- paddlenlp >= 3.0.0(默认开启flash_attn,推荐源码编译安装)
15
21
16
22
> 注:
Original file line number Diff line number Diff line change 26
26
from .minigpt4 .modeling import *
27
27
from .visualglm .configuration import *
28
28
from .visualglm .modeling import *
29
+ from .qwen_vl import *
29
30
30
31
31
32
import pkg_resources
34
35
try :
35
36
if version .startswith ('3' ):
36
37
from .internvl2 import *
37
- from .qwen_vl import *
38
+ from .qwen2_vl import *
39
+
38
40
else :
39
- print (f"paddlenlp version { version } is not 3.x, skipping import." )
41
+ print (f"paddlenlp version { version } is not 3.x, skipping import internvl2 and qwen2_vl ." )
40
42
41
43
except ImportError :
42
44
print ("paddlenlp is not installed." )
Original file line number Diff line number Diff line change 28
28
from .modeling_qwen import *
29
29
from .configuration_qwen import *
30
30
else :
31
- print (f"paddlenlp version { version } is not 3.x, skipping import." )
31
+ print (f"paddlenlp version { version } is not 3.x, skipping import Qwen2Model for llava-next ." )
32
32
33
33
except ImportError :
34
34
print ("paddlenlp is not installed." )
Original file line number Diff line number Diff line change @@ -88,6 +88,11 @@ git clone https://github.com/PaddlePaddle/PaddleMIX
88
88
cd PaddleMIX/ppdiffusers
89
89
python setup.py install
90
90
```
91
+ ### 设置代理
92
+ ``` shell
93
+ export HF_HUB_ENABLE_HF_TRANSFER=1
94
+ export HF_ENDPOINT=https://hf-mirror.com
95
+ ```
91
96
92
97
## 快速开始
93
98
我们将以扩散模型的典型代表** Stable Diffusion** 为例,带你快速了解PPDiffusers。
Original file line number Diff line number Diff line change 1
- paddlenlp = =2.7.2
1
+ paddlenlp > =2.7.2
2
2
safetensors >= 0.3.1
3
3
ftfy
4
4
regex
@@ -14,4 +14,5 @@ urllib3<=2.0.0
14
14
einops >= 0.6.1
15
15
paddlesde
16
16
ligo-segments
17
- huggingface_hub == 0.23
17
+ huggingface_hub >= 0.22.0
18
+ hf_transfer
You can’t perform that action at this time.
0 commit comments