Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -50,11 +50,12 @@ def predict_batch():
|
|
| 50 |
|
| 51 |
# Read the file into a DataFrame
|
| 52 |
input_data = pd.read_csv(file)
|
|
|
|
|
|
|
| 53 |
input_data = pipeline.transform(input_data)
|
| 54 |
# Make predictions for the batch data:
|
| 55 |
predictions = model.predict(input_data).tolist()
|
| 56 |
-
|
| 57 |
-
id_list = input_data.Product_Id.values.tolist()
|
| 58 |
output_dict = dict(zip(id_list, predictions))
|
| 59 |
|
| 60 |
return output_dict
|
|
|
|
| 50 |
|
| 51 |
# Read the file into a DataFrame
|
| 52 |
input_data = pd.read_csv(file)
|
| 53 |
+
id_list = input_data.Product_Id.values.tolist()
|
| 54 |
+
# Transform the input using the same trained pipeline:
|
| 55 |
input_data = pipeline.transform(input_data)
|
| 56 |
# Make predictions for the batch data:
|
| 57 |
predictions = model.predict(input_data).tolist()
|
| 58 |
+
|
|
|
|
| 59 |
output_dict = dict(zip(id_list, predictions))
|
| 60 |
|
| 61 |
return output_dict
|