English
Jarvis73 commited on
Commit
2a4b0d9
·
verified ·
1 Parent(s): 2c3292d

Upload ./README_zh.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README_zh.md +17 -11
README_zh.md CHANGED
@@ -25,34 +25,37 @@ huggingface-cli download Tencent-Hunyuan/TensorRT-libs --local-dir ./ckpts/t2i/m
25
  ### 2. 安装 TensorRT 依赖
26
 
27
  ```shell
 
28
  sh trt/install.sh
 
 
 
29
  ```
30
 
31
  ### 3. 构建 TensorRT engine
32
 
33
  #### 方法1: 使用预构建的 engine
34
 
35
- 本仓库提供了一些预构建的 TensorRT engine.
36
 
37
- | 支持的 GPU | 文件链接 | 远程地址 |
38
- |:----------------:|:---------------------------------------------------------------------------------------------------------------:|:---------------------------------:|
39
- | GeForce RTX 3090 | [HuggingFace](https://huggingface.co/Tencent-Hunyuan/TensorRT-engine/blob/main/engines/RTX3090/model_onnx.plan) | `engines/RTX3090/model_onnx.plan` |
40
- | GeForce RTX 4090 | [HuggingFace](https://huggingface.co/Tencent-Hunyuan/TensorRT-engine/blob/main/engines/RTX4090/model_onnx.plan) | `engines/RTX4090/model_onnx.plan` |
41
- | A100 | [HuggingFace](https://huggingface.co/Tencent-Hunyuan/TensorRT-engine/blob/main/engines/A100/model_onnx.plan) | `engines/A100/model_onnx.plan` |
42
 
43
- 可以使用以下命令下载并放置在指定的位置
44
 
45
  ```shell
46
- huggingface-cli download Tencent-Hunyuan/TensorRT-engine <远程地址> --local-dir ./ckpts/t2i/model_trt/engine
 
 
47
  ```
48
 
49
  #### 方法2: 自行构建 engine
50
  如果您使用不同于上面表格中的 GPU, 可以使用以下命令构建适配于当前 GPU 的 engine.
51
 
52
  ```shell
53
- # 首先设置 TensorRT 构建相关的环境变量,我们提供了一个脚本来一键设置
54
- source trt/activate.sh
55
-
56
  # 构建 TensorRT engine. 默认会读取当前目录下的 ckpts 文件夹
57
  sh trt/build_engine.sh
58
  ```
@@ -60,6 +63,9 @@ sh trt/build_engine.sh
60
  ### 4. 使用 TensorRT 模型进行推理.
61
 
62
  ```shell
 
 
 
63
  # 使用 prompt 强化 + 文生图 TensorRT 模型进行推理
64
  python sample_t2i.py --prompt "渔舟唱晚" --infer-mode trt
65
 
 
25
  ### 2. 安装 TensorRT 依赖
26
 
27
  ```shell
28
+ # 使用下面的命令解压并安装 TensorRT 依赖
29
  sh trt/install.sh
30
+
31
+ # 设置使用或构建 TensorRT 相关的环境变量,我们提供了一个脚本来一键设置
32
+ source trt/activate.sh
33
  ```
34
 
35
  ### 3. 构建 TensorRT engine
36
 
37
  #### 方法1: 使用预构建的 engine
38
 
39
+ 本仓库提供了一些预构建的 TensorRT engine, 需要从 Huggingface 下载.
40
 
41
+ | 支持的 GPU | 远程地址 |
42
+ |:----------------:|:---------------------------------:|
43
+ | GeForce RTX 3090 | `engines/RTX3090/model_onnx.plan` |
44
+ | GeForce RTX 4090 | `engines/RTX4090/model_onnx.plan` |
45
+ | A100 | `engines/A100/model_onnx.plan` |
46
 
47
+ 可以使用以下命令下载并放置在指定的位置. *注意: 请将 `<远程地址>` 替换为上表中对应 GPU 的远程地址.*
48
 
49
  ```shell
50
+ export REMOTE_PATH=<远程地址>
51
+ huggingface-cli download Tencent-Hunyuan/TensorRT-engine ${REMOTE_PATH} ./ckpts/t2i/model_trt/engine/
52
+ ln -s ${REMOTE_PATH} ./ckpts/t2i/model_trt/engine/model_onnx.plan
53
  ```
54
 
55
  #### 方法2: 自行构建 engine
56
  如果您使用不同于上面表格中的 GPU, 可以使用以下命令构建适配于当前 GPU 的 engine.
57
 
58
  ```shell
 
 
 
59
  # 构建 TensorRT engine. 默认会读取当前目录下的 ckpts 文件夹
60
  sh trt/build_engine.sh
61
  ```
 
63
  ### 4. 使用 TensorRT 模型进行推理.
64
 
65
  ```shell
66
+ # 重要: 如果您在使用 TensorRT 模型之前没有设置环境变量, 请使用以下命令设置
67
+ source trt/activate.sh
68
+
69
  # 使用 prompt 强化 + 文生图 TensorRT 模型进行推理
70
  python sample_t2i.py --prompt "渔舟唱晚" --infer-mode trt
71