Spaces:
Sleeping
Sleeping
removed posix
Browse files
app.py
CHANGED
|
@@ -104,8 +104,8 @@ def make_predictions(image_paths):
|
|
| 104 |
temp = None
|
| 105 |
try:
|
| 106 |
# For Windows OS
|
| 107 |
-
temp = pathlib.PosixPath # Save the original state
|
| 108 |
-
pathlib.PosixPath = pathlib.WindowsPath # Change to WindowsPath temporarily
|
| 109 |
|
| 110 |
model_path = Path(r'model/export')
|
| 111 |
learner = load_learner(model_path)
|
|
@@ -129,8 +129,8 @@ def make_predictions(image_paths):
|
|
| 129 |
except Exception as e:
|
| 130 |
return {"error in make_predictions": str(e)}
|
| 131 |
|
| 132 |
-
finally:
|
| 133 |
-
|
| 134 |
|
| 135 |
import copy
|
| 136 |
@app.route('/predict/<filenames>', methods=['GET', 'POST'])
|
|
|
|
| 104 |
temp = None
|
| 105 |
try:
|
| 106 |
# For Windows OS
|
| 107 |
+
# temp = pathlib.PosixPath # Save the original state
|
| 108 |
+
# pathlib.PosixPath = pathlib.WindowsPath # Change to WindowsPath temporarily
|
| 109 |
|
| 110 |
model_path = Path(r'model/export')
|
| 111 |
learner = load_learner(model_path)
|
|
|
|
| 129 |
except Exception as e:
|
| 130 |
return {"error in make_predictions": str(e)}
|
| 131 |
|
| 132 |
+
# finally:
|
| 133 |
+
# pathlib.PosixPath = temp
|
| 134 |
|
| 135 |
import copy
|
| 136 |
@app.route('/predict/<filenames>', methods=['GET', 'POST'])
|