bugfix
Browse files
app.py
CHANGED
@@ -112,8 +112,8 @@ def make_predictions(image_paths):
|
|
112 |
temp = None
|
113 |
try:
|
114 |
# For Windows OS
|
115 |
-
temp = pathlib.PosixPath # Save the original state
|
116 |
-
pathlib.PosixPath = pathlib.WindowsPath # Change to WindowsPath temporarily
|
117 |
|
118 |
model_path = Path(r'model/export')
|
119 |
learner = load_learner(model_path)
|
@@ -137,8 +137,8 @@ def make_predictions(image_paths):
|
|
137 |
except Exception as e:
|
138 |
return {"error in make_predictions": str(e)}
|
139 |
|
140 |
-
finally:
|
141 |
-
|
142 |
|
143 |
|
144 |
@app.route('/predict/<filenames>', methods=['GET', 'POST'])
|
|
|
112 |
temp = None
|
113 |
try:
|
114 |
# For Windows OS
|
115 |
+
# temp = pathlib.PosixPath # Save the original state
|
116 |
+
# pathlib.PosixPath = pathlib.WindowsPath # Change to WindowsPath temporarily
|
117 |
|
118 |
model_path = Path(r'model/export')
|
119 |
learner = load_learner(model_path)
|
|
|
137 |
except Exception as e:
|
138 |
return {"error in make_predictions": str(e)}
|
139 |
|
140 |
+
# finally:
|
141 |
+
# pathlib.PosixPath = temp
|
142 |
|
143 |
|
144 |
@app.route('/predict/<filenames>', methods=['GET', 'POST'])
|