Skip to content

Commit 40e1af8

Browse files
committed
f
Signed-off-by: oliver könig <okoenig@nvidia.com>
1 parent 0b59161 commit 40e1af8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

nemo_export/multimodal/build.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from time import time
2222
from typing import List
2323

24-
import tensorrt as trt
2524
import torch
2625
import yaml
2726
from PIL import Image
@@ -35,9 +34,15 @@
3534

3635
from nemo_export.tensorrt_llm import TensorRTLLM
3736
from nemo_export.trt_llm.nemo_ckpt_loader.nemo_file import load_nemo_model
37+
from nemo_export_deploy_common.import_utils import UnavailableError
3838

3939
from .converter import convert_mllama_nemo_to_hf
4040

41+
try:
42+
import tensorrt as trt
43+
except (ImportError, ModuleNotFoundError) as e:
44+
raise UnavailableError("tensorrt is not available. Please install it with `pip install nvidia-tensorrt`.") from e
45+
4146
logger = trt.Logger(trt.Logger.INFO)
4247

4348

0 commit comments

Comments
 (0)