Terence9 commited on
Commit
bb99cf9
·
verified ·
1 Parent(s): 5580d59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -7,9 +7,10 @@ from werkzeug.utils import secure_filename
7
  from predict import predict_waste
8
 
9
  app = Flask(__name__)
10
- app.config['UPLOAD_FOLDER'] = 'uploads'
 
11
  app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # 16MB max file size
12
- app.config['HISTORY_FILE'] = 'prediction_history.json'
13
 
14
  # Ensure upload directory exists
15
  os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
@@ -83,4 +84,4 @@ def clear_history():
83
  return jsonify({'success': True})
84
 
85
  if __name__ == '__main__':
86
- app.run(debug=True)
 
7
  from predict import predict_waste
8
 
9
  app = Flask(__name__)
10
+ BASE_DIR = os.path.dirname(os.path.abspath(__file__))
11
+ app.config['UPLOAD_FOLDER'] = os.path.join(BASE_DIR, 'uploads')
12
  app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # 16MB max file size
13
+ app.config['HISTORY_FILE'] = os.path.join(BASE_DIR, 'prediction_history.json')
14
 
15
  # Ensure upload directory exists
16
  os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
 
84
  return jsonify({'success': True})
85
 
86
  if __name__ == '__main__':
87
+ app.run(host='0.0.0.0', port=7860, debug=True)