WebashalarForML commited on
Commit
44073b3
·
verified ·
1 Parent(s): f09cc42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -35,6 +35,7 @@ os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
35
 
36
  app.config['DATA_FOLDER'] = UPLOAD_FOLDER
37
  os.makedirs(app.config['DATA_FOLDER'], exist_ok=True)
 
38
 
39
  app.config['MODEL_FOLDER'] = UPLOAD_FOLDER
40
  os.makedirs(app.config['MODEL_FOLDER'], exist_ok=True)
@@ -163,6 +164,10 @@ def predict():
163
 
164
  # Process the DataFrame and generate predictions and classification analysis.
165
  df_pred, dx_class = process_dataframe(df)
 
 
 
 
166
 
167
  # Save output files with a timestamp (you can also store in session if needed)
168
  current_date = pd.Timestamp.now().strftime("%Y-%m-%d")
 
35
 
36
  app.config['DATA_FOLDER'] = UPLOAD_FOLDER
37
  os.makedirs(app.config['DATA_FOLDER'], exist_ok=True)
38
+ os.makedirs("data", exist_ok=True)
39
 
40
  app.config['MODEL_FOLDER'] = UPLOAD_FOLDER
41
  os.makedirs(app.config['MODEL_FOLDER'], exist_ok=True)
 
164
 
165
  # Process the DataFrame and generate predictions and classification analysis.
166
  df_pred, dx_class = process_dataframe(df)
167
+ if df_pred.empty:
168
+ print("Processed prediction DataFrame is empty. Check the input file and processing logic.", "error")
169
+ return redirect(request.url)
170
+
171
 
172
  # Save output files with a timestamp (you can also store in session if needed)
173
  current_date = pd.Timestamp.now().strftime("%Y-%m-%d")