OVH commited on
Commit
fb2bc8c
·
1 Parent(s): 64ba780

Some files appropriated

Browse files
Files changed (2) hide show
  1. .ipynb_checkpoints/app-checkpoint.py +4 -6
  2. app.py +4 -4
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -128,20 +128,20 @@ def predict():
128
 
129
  data = request.json
130
 
131
- # Extract train, test, and test_size with defaults
132
  train = data.get('train', False)
133
  test = data.get('test', False)
134
- test_size = float(data.get('test_size', 0.1))
135
 
136
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
137
 
138
  # Handle training mode
139
  if train in (True, 'true', 'True'):
140
- start_pipelines(test_size=test_size)
141
  logger.info("PIPELINES FINISHED SUCCESSFULLY")
142
  return jsonify({
143
  'message': 'Training pipelines executed successfully',
144
- 'test_size': test_size
145
  }), 200
146
 
147
  # Handle testing/inference mode
@@ -277,5 +277,3 @@ def predict():
277
  except Exception as e:
278
  return jsonify({'error': str(e)}), 500
279
 
280
- if __name__ == '__main__':
281
- app.run(debug=True, host='0.0.0.0', port=5000)
 
128
 
129
  data = request.json
130
 
131
+ # Extract train, test, and train_size with defaults
132
  train = data.get('train', False)
133
  test = data.get('test', False)
134
+ train_size = float(data.get('train_size', 0.1))
135
 
136
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
137
 
138
  # Handle training mode
139
  if train in (True, 'true', 'True'):
140
+ start_pipelines(train_size=train_size)
141
  logger.info("PIPELINES FINISHED SUCCESSFULLY")
142
  return jsonify({
143
  'message': 'Training pipelines executed successfully',
144
+ 'train_size': train_size
145
  }), 200
146
 
147
  # Handle testing/inference mode
 
277
  except Exception as e:
278
  return jsonify({'error': str(e)}), 500
279
 
 
 
app.py CHANGED
@@ -128,20 +128,20 @@ def predict():
128
 
129
  data = request.json
130
 
131
- # Extract train, test, and test_size with defaults
132
  train = data.get('train', False)
133
  test = data.get('test', False)
134
- test_size = float(data.get('train_size', 0.1))
135
 
136
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
137
 
138
  # Handle training mode
139
  if train in (True, 'true', 'True'):
140
- start_pipelines(test_size=test_size)
141
  logger.info("PIPELINES FINISHED SUCCESSFULLY")
142
  return jsonify({
143
  'message': 'Training pipelines executed successfully',
144
- 'test_size': test_size
145
  }), 200
146
 
147
  # Handle testing/inference mode
 
128
 
129
  data = request.json
130
 
131
+ # Extract train, test, and train_size with defaults
132
  train = data.get('train', False)
133
  test = data.get('test', False)
134
+ train_size = float(data.get('train_size', 0.1))
135
 
136
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
137
 
138
  # Handle training mode
139
  if train in (True, 'true', 'True'):
140
+ start_pipelines(train_size=train_size)
141
  logger.info("PIPELINES FINISHED SUCCESSFULLY")
142
  return jsonify({
143
  'message': 'Training pipelines executed successfully',
144
+ 'train_size': train_size
145
  }), 200
146
 
147
  # Handle testing/inference mode