ayush2917 commited on
Commit
8d81f9d
·
verified ·
1 Parent(s): 34e8f77

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -27,7 +27,6 @@ logger = logging.getLogger(__name__)
27
  models_loaded = False
28
  start_time = time.time()
29
 
30
- @app.before_first_request
31
  def initialize_services():
32
  global models_loaded
33
 
@@ -62,7 +61,7 @@ def initialize_services():
62
  def home():
63
  return render_template('index.html')
64
 
65
- @app.route('/ask', methods=['POST']) # Updated endpoint to match HTML
66
  def chat():
67
  if not models_loaded:
68
  return jsonify({
@@ -108,5 +107,5 @@ def get_history():
108
  return jsonify(app.history.get_history())
109
 
110
  if __name__ == '__main__':
111
- initialize_services()
112
  app.run(host='0.0.0.0', port=8000)
 
27
  models_loaded = False
28
  start_time = time.time()
29
 
 
30
  def initialize_services():
31
  global models_loaded
32
 
 
61
  def home():
62
  return render_template('index.html')
63
 
64
+ @app.route('/ask', methods=['POST'])
65
  def chat():
66
  if not models_loaded:
67
  return jsonify({
 
107
  return jsonify(app.history.get_history())
108
 
109
  if __name__ == '__main__':
110
+ initialize_services() # Initialize services before starting the app
111
  app.run(host='0.0.0.0', port=8000)