Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -32,7 +32,7 @@ def predict():
|
|
| 32 |
}
|
| 33 |
input_data = pd.DataFrame([sample])
|
| 34 |
prediction = model.predict(input_data).tolist()[0]
|
| 35 |
-
return jsonify({"
|
| 36 |
|
| 37 |
|
| 38 |
@app.post("/v1/productbatch")
|
|
@@ -40,7 +40,7 @@ def predict_batch():
|
|
| 40 |
file = request.files["file"]
|
| 41 |
input_data = pd.read_csv(file)
|
| 42 |
predictions = model.predict(input_data).tolist()
|
| 43 |
-
input_data["
|
| 44 |
result = input_data.to_dict(orient="records")
|
| 45 |
return jsonify(result)
|
| 46 |
|
|
|
|
| 32 |
}
|
| 33 |
input_data = pd.DataFrame([sample])
|
| 34 |
prediction = model.predict(input_data).tolist()[0]
|
| 35 |
+
return jsonify({"Prediction": prediction})
|
| 36 |
|
| 37 |
|
| 38 |
@app.post("/v1/productbatch")
|
|
|
|
| 40 |
file = request.files["file"]
|
| 41 |
input_data = pd.read_csv(file)
|
| 42 |
predictions = model.predict(input_data).tolist()
|
| 43 |
+
input_data["Prediction"] = predictions
|
| 44 |
result = input_data.to_dict(orient="records")
|
| 45 |
return jsonify(result)
|
| 46 |
|