@@ -1279,7 +1279,7 @@ def get_requirements_filepath(self) -> str:
12791279 # then GPU, then CPU. With a query at each step for OS and architecture.
12801280
12811281 filename = ""
1282- os_name = self .system_info .os .lower ()
1282+ os = self .system_info .os .lower ()
12831283 arch = self .system_info .cpu_arch .lower ()
12841284
12851285 if self .system_info .system == 'Raspberry Pi' :
@@ -1302,34 +1302,34 @@ def get_requirements_filepath(self) -> str:
13021302
13031303 if self .system_info .hasTorchCuda :
13041304 # TODO: Get the specific CUDA version and then add tests for .cudaMajor, .cudaMajor_Minor
1305- if os .path .exists (os .path .join (self .module_path , f"requirements.{ os_name } .{ arch } .cuda.txt" )):
1306- filename = f"requirements.{ os_name } .{ arch } .cuda.txt"
1307- elif os .path .exists (os .path .join (self .module_path , f"requirements.{ os_name } .cuda.txt" )):
1308- filename = f"requirements.{ os_name } .cuda.txt"
1305+ if os .path .exists (os .path .join (self .module_path , f"requirements.{ os } .{ arch } .cuda.txt" )):
1306+ filename = f"requirements.{ os } .{ arch } .cuda.txt"
1307+ elif os .path .exists (os .path .join (self .module_path , f"requirements.{ os } .cuda.txt" )):
1308+ filename = f"requirements.{ os } .cuda.txt"
13091309 elif os .path .exists (os .path .join (self .module_path , f"requirements.cuda.txt" )):
13101310 filename = f"requirements.cuda.txt"
13111311
13121312 if self .system_info .hasTorchROCm :
1313- if os .path .exists (os .path .join (self .module_path , f"requirements.{ os_name } .{ arch } .rocm.txt" )):
1314- filename = f"requirements.{ os_name } .{ arch } .rocm.txt"
1315- elif os .path .exists (os .path .join (self .module_path , f"requirements.{ os_name } .rocm.txt" )):
1316- filename = f"requirements.{ os_name } .rocm.txt"
1313+ if os .path .exists (os .path .join (self .module_path , f"requirements.{ os } .{ arch } .rocm.txt" )):
1314+ filename = f"requirements.{ os } .{ arch } .rocm.txt"
1315+ elif os .path .exists (os .path .join (self .module_path , f"requirements.{ os } .rocm.txt" )):
1316+ filename = f"requirements.{ os } .rocm.txt"
13171317 elif os .path .exists (os .path .join (self .module_path , f"requirements.rocm.txt" )):
13181318 filename = f"requirements.rocm.txt"
13191319
13201320 if not filename :
1321- if os .path .exists (os .path .join (self .module_path , f"requirements.{ os_name } .{ arch } .gpu.txt" )):
1322- filename = f"requirements.{ os_name } .{ arch } .gpu.txt"
1323- elif os .path .exists (os .path .join (self .module_path , f"requirements.{ os_name } .gpu.txt" )):
1324- filename = f"requirements.{ os_name } .gpu.txt"
1321+ if os .path .exists (os .path .join (self .module_path , f"requirements.{ os } .{ arch } .gpu.txt" )):
1322+ filename = f"requirements.{ os } .{ arch } .gpu.txt"
1323+ elif os .path .exists (os .path .join (self .module_path , f"requirements.{ os } .gpu.txt" )):
1324+ filename = f"requirements.{ os } .gpu.txt"
13251325 elif os .path .exists (os .path .join (self .module_path , f"requirements.gpu.txt" )):
13261326 filename = f"requirements.gpu.txt"
13271327
13281328 if not filename :
1329- if os .path .exists (os .path .join (self .module_path , f"requirements.{ os_name } .{ arch } .txt" )):
1330- filename = f"requirements.{ os_name } .{ arch } .txt"
1331- elif os .path .exists (os .path .join (self .module_path , f"requirements.{ os_name } .txt" )):
1332- filename = f"requirements.{ os_name } .txt"
1329+ if os .path .exists (os .path .join (self .module_path , f"requirements.{ os } .{ arch } .txt" )):
1330+ filename = f"requirements.{ os } .{ arch } .txt"
1331+ elif os .path .exists (os .path .join (self .module_path , f"requirements.{ os } .txt" )):
1332+ filename = f"requirements.{ os } .txt"
13331333 elif os .path .exists (os .path .join (self .module_path , f"requirements.txt" )):
13341334 filename = f"requirements.txt"
13351335
0 commit comments