File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1111# pyre-unsafe
1212
1313import logging
14- from pathlib import Path
1514
1615import torch
1716
2322 op2 = torch .ops .llama .fast_hadamard_transform .default
2423 assert op2 is not None
2524except :
26- libs = list (Path (__file__ ).parent .resolve ().glob ("libcustom_ops_aot_lib.*" ))
25+ import glob
26+
27+ import executorch
28+
29+ executorch_package_path = executorch .__path__ [0 ]
30+ logging .info (f"Looking for libcustom_ops_aot_lib.so in { executorch_package_path } " )
31+ libs = list (
32+ glob .glob (
33+ f"{ executorch_package_path } /**/libcustom_ops_aot_lib.*" , recursive = True
34+ )
35+ )
2736 assert len (libs ) == 1 , f"Expected 1 library but got { len (libs )} "
2837 logging .info (f"Loading custom ops library: { libs [0 ]} " )
2938 torch .ops .load_library (libs [0 ])
You can’t perform that action at this time.
0 commit comments