Upload ./README_zh.md with huggingface_hub
Browse files24 unmodified lines252627282930313233343536373839404142434445464748495051525354555657581 unmodified line60616263646524 unmodified lines### 2. 安装 TensorRT 依赖```shellsh trt/install.sh```### 3. 构建 TensorRT engine#### 方法1: 使用预构建的 engine本仓库提供了一些预构建的 TensorRT engine.| 支持的 GPU | 文件链接 | 远程地址 ||:----------------:|:---------------------------------------------------------------------------------------------------------------:|:---------------------------------:|| GeForce RTX 3090 | [HuggingFace](https://huggingface.co/Tencent-Hunyuan/TensorRT-engine/blob/main/engines/RTX3090/model_onnx.plan) | `engines/RTX3090/model_onnx.plan` || GeForce RTX 4090 | [HuggingFace](https://huggingface.co/Tencent-Hunyuan/TensorRT-engine/blob/main/engines/RTX4090/model_onnx.plan) | `engines/RTX4090/model_onnx.plan` || A100 | [HuggingFace](https://huggingface.co/Tencent-Hunyuan/TensorRT-engine/blob/main/engines/A100/model_onnx.plan) | `engines/A100/model_onnx.plan` |可以使用以下命令下载并放置在指定的位置```shellhuggingface-cli download Tencent-Hunyuan/TensorRT-engine <远程地址> --local-dir ./ckpts/t2i/model_trt/engine```#### 方法2: 自行构建 engine如果您使用不同于上面表格中的 GPU, 可以使用以下命令构建适配于当前 GPU 的 engine.```shell# 首先设置 TensorRT 构建相关的环境变量,我们提供了一个脚本来一键设置source trt/activate.sh# 构建 TensorRT engine. 默认会读取当前目录下的 ckpts 文件夹sh trt/build_engine.sh```1 unmodified line### 4. 使用 TensorRT 模型进行推理.```shell# 使用 prompt 强化 + 文生图 TensorRT 模型进行推理python sample_t2i.py --prompt "渔舟唱晚" --infer-mode trt24 unmodified lines252627282930313233343536373839404142434445464748495051525354555657585960611 unmodified line63646566676869707124 unmodified lines### 2. 安装 TensorRT 依赖```shell# 使用下面的命令解压并安装 TensorRT 依赖sh trt/install.sh# 设置使用或构建 TensorRT 相关的环境变量,我们提供了一个脚本来一键设置source trt/activate.sh```### 3. 构建 TensorRT engine#### 方法1: 使用预构建的 engine本仓库提供了一些预构建的 TensorRT engine, 需要从 Huggingface 下载.| 支持的 GPU | 远程地址 ||:----------------:|:---------------------------------:|| GeForce RTX 3090 | `engines/RTX3090/model_onnx.plan` || GeForce RTX 4090 | `engines/RTX4090/model_onnx.plan` || A100 | `engines/A100/model_onnx.plan` |可以使用以下命令下载并放置在指定的位置. *注意: 请将 `<远程地址>` 替换为上表中对应 GPU 的远程地址.*```shellexport REMOTE_PATH=<远程地址>huggingface-cli download Tencent-Hunyuan/TensorRT-engine ${REMOTE_PATH} ./ckpts/t2i/model_trt/engine/ln -s ${REMOTE_PATH} ./ckpts/t2i/model_trt/engine/model_onnx.plan```#### 方法2: 自行构建 engine如果您使用不同于上面表格中的 GPU, 可以使用以下命令构建适配于当前 GPU 的 engine.```shell# 构建 TensorRT engine. 默认会读取当前目录下的 ckpts 文件夹sh trt/build_engine.sh```1 unmodified line### 4. 使用 TensorRT 模型进行推理.```shell# 重要: 如果您在使用 TensorRT 模型之前没有设置环境变量, 请使用以下命令设置source trt/activate.sh# 使用 prompt 强化 + 文生图 TensorRT 模型进行推理python sample_t2i.py --prompt "渔舟唱晚" --infer-mode trt
README_zh.md+17-11