Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import pandas as pd # For data manipulation
|
|
| 6 |
from flask import Flask, request, jsonify # For creating the Flask API
|
| 7 |
|
| 8 |
# Initialize Flask app with a name
|
| 9 |
-
superkart_api = Flask("ABMs
|
| 10 |
|
| 11 |
# Load the trained prediction model
|
| 12 |
model = joblib.load("nozzle_selection.joblib") #define the location of the serialized model
|
|
@@ -46,7 +46,7 @@ def predict_nozzle():
|
|
| 46 |
prediction = model.predict(input_data).tolist()[0]
|
| 47 |
|
| 48 |
# Return the prediction as a JSON response
|
| 49 |
-
return jsonify({'
|
| 50 |
|
| 51 |
# Define an endpoint for batch prediction (POST request)
|
| 52 |
@nozzleselect_api.post('/v1/predictbatch')
|
|
|
|
| 6 |
from flask import Flask, request, jsonify # For creating the Flask API
|
| 7 |
|
| 8 |
# Initialize Flask app with a name
|
| 9 |
+
superkart_api = Flask("ABMs-Nozzle-Selection") #define the name of the app
|
| 10 |
|
| 11 |
# Load the trained prediction model
|
| 12 |
model = joblib.load("nozzle_selection.joblib") #define the location of the serialized model
|
|
|
|
| 46 |
prediction = model.predict(input_data).tolist()[0]
|
| 47 |
|
| 48 |
# Return the prediction as a JSON response
|
| 49 |
+
return jsonify({'nozzle': prediction})
|
| 50 |
|
| 51 |
# Define an endpoint for batch prediction (POST request)
|
| 52 |
@nozzleselect_api.post('/v1/predictbatch')
|