File tree 1 file changed +15
-16
lines changed
1 file changed +15
-16
lines changed Original file line number Diff line number Diff line change 4
4
import gc
5
5
import logging
6
6
import os
7
- import shutil
8
- import subprocess
9
- import sys
10
7
import urllib .request
11
8
import warnings
12
9
from dataclasses import fields , replace
@@ -847,20 +844,22 @@ def download_plugin_lib_path(py_version: str, platform: str) -> str:
847
844
848
845
# Proceeding with the unzip of the wheel file
849
846
# This will exist if the filename was already downloaded
850
- if os . path . exists ( "./tensorrt_llm/libs/libnvinfer_plugin_tensorrt_llm.so" ) :
851
- plugin_lib_path = "./tensorrt_llm/libs/" + "libnvinfer_plugin_tensorrt_llm.so"
847
+ if "linux" in platform :
848
+ lib_filename = "libnvinfer_plugin_tensorrt_llm.so"
852
849
else :
853
- try :
854
- import zipfile
855
- except :
856
- raise ImportError (
857
- "zipfile module is required but not found. Please install zipfile"
858
- )
859
- with zipfile .ZipFile (file_name , "r" ) as zip_ref :
860
- zip_ref .extractall ("." ) # Extract to a folder named 'tensorrt_llm'
861
- plugin_lib_path = (
862
- "./tensorrt_llm/libs/" + "libnvinfer_plugin_tensorrt_llm.so"
863
- )
850
+ lib_filename = "libnvinfer_plugin_tensorrt_llm.dll"
851
+ plugin_lib_path = os .path .join ("./tensorrt_llm/libs" , lib_filename )
852
+ if os .path .exists (plugin_lib_path ):
853
+ return plugin_lib_path
854
+ try :
855
+ import zipfile
856
+ except :
857
+ raise ImportError (
858
+ "zipfile module is required but not found. Please install zipfile"
859
+ )
860
+ with zipfile .ZipFile (file_name , "r" ) as zip_ref :
861
+ zip_ref .extractall ("." ) # Extract to a folder named 'tensorrt_llm'
862
+ plugin_lib_path = "./tensorrt_llm/libs/" + lib_filename
864
863
return plugin_lib_path
865
864
866
865
You can’t perform that action at this time.
0 commit comments