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