Scezui commited on
Commit
8cbfe3e
·
1 Parent(s): 6ffd275
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -105,9 +105,9 @@ def upload_files():
105
  def make_predictions(image_paths):
106
  temp = None
107
  try:
108
- # For Windows OS
109
- temp = pathlib.PosixPath # Save the original state
110
- pathlib.PosixPath = pathlib.WindowsPath # Change to WindowsPath temporarily
111
 
112
  model_path = Path(r'model/export')
113
  learner = load_learner(model_path)
@@ -131,8 +131,8 @@ def make_predictions(image_paths):
131
  except Exception as e:
132
  return {"error in make_predictions": str(e)}
133
 
134
- finally:
135
- pathlib.PosixPath = temp
136
 
137
 
138
  @app.route('/predict/<filenames>', methods=['GET', 'POST'])
 
105
  def make_predictions(image_paths):
106
  temp = None
107
  try:
108
+ # # For Windows OS
109
+ # temp = pathlib.PosixPath # Save the original state
110
+ # pathlib.PosixPath = pathlib.WindowsPath # Change to WindowsPath temporarily
111
 
112
  model_path = Path(r'model/export')
113
  learner = load_learner(model_path)
 
131
  except Exception as e:
132
  return {"error in make_predictions": str(e)}
133
 
134
+ # finally:
135
+ # pathlib.PosixPath = temp
136
 
137
 
138
  @app.route('/predict/<filenames>', methods=['GET', 'POST'])