@@ -137,7 +137,7 @@ def get_tests_dir(append_path=None):
137
137
tests_dir = os .path .dirname (tests_dir )
138
138
139
139
if append_path :
140
- return os . path . join (tests_dir , append_path )
140
+ return Path (tests_dir , append_path ). as_posix ( )
141
141
else :
142
142
return tests_dir
143
143
@@ -335,10 +335,9 @@ def python39_available():
335
335
336
336
def load_numpy (arry : Union [str , np .ndarray ], local_path : Optional [str ] = None ) -> np .ndarray :
337
337
if isinstance (arry , str ):
338
- # local_path = "/home/patrick_huggingface_co/"
339
338
if local_path is not None :
340
339
# local_path can be passed to correct images of tests
341
- return os . path . join (local_path , "/" . join ([ arry .split ("/" )[- 5 ], arry .split ("/" )[- 2 ], arry .split ("/" )[- 1 ]]) )
340
+ return Path (local_path , arry .split ("/" )[- 5 ], arry .split ("/" )[- 2 ], arry .split ("/" )[- 1 ]). as_posix ( )
342
341
elif arry .startswith ("http://" ) or arry .startswith ("https://" ):
343
342
response = requests .get (arry )
344
343
response .raise_for_status ()
@@ -521,9 +520,9 @@ def export_to_video(video_frames: List[np.ndarray], output_video_path: str = Non
521
520
522
521
def load_hf_numpy (path ) -> np .ndarray :
523
522
if not path .startswith ("http://" ) or path .startswith ("https://" ):
524
- path = os . path . join (
523
+ path = Path (
525
524
"https://huggingface.co/datasets/fusing/diffusers-testing/resolve/main" , urllib .parse .quote (path )
526
- )
525
+ ). as_posix ()
527
526
528
527
return load_numpy (path )
529
528
0 commit comments