Upload ./README.md with huggingface_hub
Browse files33 unmodified lines34353637383940414243441 unmodified line4647484549504748495051515253545556535758596061625663646566671 unmodified line6970716465667273743 unmodified lines78798081828384858633 unmodified lines### 2. Install the TensorRT dependencies.
```shell
# Extract and install the TensorRT dependencies.
sh trt/install.sh
# Set the TensorRT build environment variables. We provide a script to set up the environment.
source trt/activate.sh
```
### 3. Build the TensorRT engine.1 unmodified line
#### Method 1: Use the prebuilt engine
We provide some prebuilt TensorRT engines.
We provide some prebuilt TensorRT engines, which need to be downloaded from Huggingface.
| Supported GPU | Download Link | Remote Path |
|:----------------:|:---------------------------------------------------------------------------------------------------------------:|:---------------------------------:|
| 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` |
| Supported GPU | Remote Path |
|:----------------:|:---------------------------------:|
| GeForce RTX 3090 | `engines/RTX3090/model_onnx.plan` |
| GeForce RTX 4090 | `engines/RTX4090/model_onnx.plan` |
| A100 | `engines/A100/model_onnx.plan` |
Use the following command to download and place the engine in the specified location.
Use the following command to download and place the engine in the specified location.
*Note: Please replace `<Remote Path>` with the corresponding remote path in the table above.*
```shell
export REMOTE_PATH=<Remote Path>
huggingface-cli download Tencent-Hunyuan/TensorRT-engine <Remote Path> --local-dir ./ckpts/t2i/model_trt/engine
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
```
#### Method 2: Build your own engine1 unmodified lineIf you are using a different GPU, you can build the engine using the following command.
```shell
# Set the TensorRT build environment variables first. We provide a script to set up the environment.
source trt/activate.sh
# Build the TensorRT engine. By default, it will read the `ckpts` folder in the current directory.
sh trt/build_engine.sh
```3 unmodified lines### 4. Run the inference using the TensorRT model.
```shell
# Important: If you have not activated the environment, please run the following command.
source trt/activate.sh
# Run the inference using the prompt-enhanced model + HunyuanDiT TensorRT model.
python sample_t2i.py --prompt "渔舟唱晚" --infer-mode trt
README.md+19-11