Spaces:
Sleeping
Sleeping
Meet Radadiya commited on
Commit ·
aaa20cf
1
Parent(s): c4863c5
Fix: patch WindowsPath only on Linux for cross-platform checkpoint loading
Browse files
src/inference/predictor.py
CHANGED
|
@@ -4,7 +4,11 @@ PREDICTOR — Single Image Inference Pipeline
|
|
| 4 |
=================================================================
|
| 5 |
"""
|
| 6 |
import pathlib
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
import torch
|
|
|
|
| 4 |
=================================================================
|
| 5 |
"""
|
| 6 |
import pathlib
|
| 7 |
+
import platform
|
| 8 |
+
|
| 9 |
+
# Fix for loading Windows-saved checkpoints on Linux
|
| 10 |
+
if platform.system() == "Linux":
|
| 11 |
+
pathlib.WindowsPath = pathlib.PosixPath
|
| 12 |
|
| 13 |
|
| 14 |
import torch
|