diff --git a/cosyvoice/cli/model.py b/cosyvoice/cli/model.py index 20de439..9995c44 100644 --- a/cosyvoice/cli/model.py +++ b/cosyvoice/cli/model.py @@ -87,6 +87,8 @@ class CosyVoiceModel: assert torch.cuda.is_available(), 'tensorrt only supports gpu!' if not os.path.exists(flow_decoder_estimator_model): convert_onnx_to_trt(flow_decoder_estimator_model, flow_decoder_onnx_model, fp16) + if os.path.getsize(flow_decoder_estimator_model) == 0: + raise ValueError('{} is empty file, delete it and export again!'.format(flow_decoder_estimator_model)) del self.flow.decoder.estimator import tensorrt as trt with open(flow_decoder_estimator_model, 'rb') as f: