add trt script TODO

This commit is contained in:
lyuxiang.lx
2024-08-29 10:44:04 +08:00
parent 8b097f7625
commit f1e374a9bb
5 changed files with 31 additions and 7 deletions

View File

@@ -44,7 +44,7 @@ def main():
torch._C._jit_set_profiling_mode(False)
torch._C._jit_set_profiling_executor(False)
cosyvoice = CosyVoice(args.model_dir, load_script=False)
cosyvoice = CosyVoice(args.model_dir, load_jit=False, load_trt=False)
# 1. export llm text_encoder
llm_text_encoder = cosyvoice.model.llm.text_encoder.half()

View File

@@ -0,0 +1,8 @@
# TODO 跟export_jit一样的逻辑完成flow部分的estimator的onnx导出。
# tensorrt的安装方式再这里写一下步骤提示如下如果没有安装那么不要执行这个脚本提示用户先安装不给选择
try:
import tensorrt
except ImportError:
print('step1, 下载\n step2. 解压安装whl')
# 安装命令里tensosrt的根目录用环境变量导入比如os.environ['tensorrt_root_dir']/bin/exetrace然后python里subprocess里执行导出命令
# 后面我会在run.sh里写好执行命令 tensorrt_root_dir=xxxx python cosyvoice/bin/export_trt.py --model_dir xxx