potential fix to pre-load DLL dir for torch-mlir (#848)

Doesn't regress the main.py script but system already pre-loaded
the DLL so needs more testing.
This commit is contained in:
powderluv
2023-01-20 14:48:45 -08:00
committed by GitHub
parent 30b29ce8cd
commit 6c470d8131

View File

@@ -1,6 +1,11 @@
import os
import sysconfig
os.environ["AMD_ENABLE_LLPC"] = "1"
# Preload DLL paths for torch-mlir
os.add_dll_directory(
os.path.join(sysconfig.get_paths()["purelib"], "torch_mlir/_mlir_libs")
)
from transformers import CLIPTextModel, CLIPTokenizer
import torch