File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed
Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change 5252# imports.
5353import logging
5454import os
55+ import platform
5556import re
5657import shutil
5758import site
@@ -92,6 +93,23 @@ def _is_windows() -> bool:
9293 return sys .platform == "win32"
9394
9495
96+ # Duplicate of the one in backends.qualcomm.scripts.download_qnn_sdk to avoid
97+ # import errors.
98+ def is_linux_x86 () -> bool :
99+ """
100+ Check if the current platform is Linux x86_64.
101+
102+ Returns:
103+ bool: True if the system is Linux x86_64, False otherwise.
104+ """
105+ return platform .system ().lower () == "linux" and platform .machine ().lower () in (
106+ "x86_64" ,
107+ "amd64" ,
108+ "i386" ,
109+ "i686" ,
110+ )
111+
112+
95113class Version :
96114 """Static strings that describe the version of the pip package."""
97115
@@ -465,8 +483,6 @@ def run(self):
465483
466484 try :
467485 # Following code is for building the Qualcomm backend.
468- from backends .qualcomm .scripts .download_qnn_sdk import is_linux_x86
469-
470486 if is_linux_x86 ():
471487 os .environ ["EXECUTORCH_BUILDING_WHEEL" ] = "1"
472488 from backends .qualcomm .scripts .download_qnn_sdk import _download_qnn_sdk
@@ -535,8 +551,8 @@ def run(self):
535551 self .copy_file (str (so_src ), str (so_dst ))
536552 logging .info (f"Copied Qualcomm backend: { so_src } -> { so_dst } " )
537553
538- except ImportError as e :
539- logging .error (f"Fail to build Qualcomm backend: { e } " )
554+ except ImportError :
555+ logging .error (f"Fail to build Qualcomm backend" )
540556 logging .exception ("Import error" )
541557
542558 if self .editable_mode :
You can’t perform that action at this time.
0 commit comments