Update product_return_prediction/api.py
Browse files
product_return_prediction/api.py
CHANGED
@@ -8,6 +8,7 @@ import pickle
|
|
8 |
import requests
|
9 |
from pathlib import Path
|
10 |
from product_return_prediction.dataset import prepare_inventory, scale_data_with_trained_scaler
|
|
|
11 |
from product_return_prediction.config import MODELS_DIR, EXTERNAL_DATA_DIR
|
12 |
from huggingface_hub import hf_hub_download
|
13 |
|
@@ -16,6 +17,7 @@ app = FastAPI(
|
|
16 |
description="This API predicts whether a product will be returned based on products and user behavior.",
|
17 |
version="0.1.0"
|
18 |
)
|
|
|
19 |
|
20 |
|
21 |
class ProductRequest(BaseModel):
|
|
|
8 |
import requests
|
9 |
from pathlib import Path
|
10 |
from product_return_prediction.dataset import prepare_inventory, scale_data_with_trained_scaler
|
11 |
+
from product_return_prediction.monitoring import instrumentator
|
12 |
from product_return_prediction.config import MODELS_DIR, EXTERNAL_DATA_DIR
|
13 |
from huggingface_hub import hf_hub_download
|
14 |
|
|
|
17 |
description="This API predicts whether a product will be returned based on products and user behavior.",
|
18 |
version="0.1.0"
|
19 |
)
|
20 |
+
instrumentator.instrument(app).expose(app, include_in_schema=False, should_gzip=True)
|
21 |
|
22 |
|
23 |
class ProductRequest(BaseModel):
|