Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import numpy as np
|
|
| 4 |
from pydantic import BaseModel
|
| 5 |
from typing import List
|
| 6 |
from fastapi import HTTPException
|
|
|
|
| 7 |
|
| 8 |
def load_preprocessing_components():
|
| 9 |
with open("encoder.pkl", "rb") as f:
|
|
@@ -12,6 +13,8 @@ def load_preprocessing_components():
|
|
| 12 |
scaler = dill.load(f)
|
| 13 |
return encoder, scaler
|
| 14 |
|
|
|
|
|
|
|
| 15 |
|
| 16 |
class InferenceData(BaseModel):
|
| 17 |
Age: float
|
|
|
|
| 4 |
from pydantic import BaseModel
|
| 5 |
from typing import List
|
| 6 |
from fastapi import HTTPException
|
| 7 |
+
from model_load_save import load_model
|
| 8 |
|
| 9 |
def load_preprocessing_components():
|
| 10 |
with open("encoder.pkl", "rb") as f:
|
|
|
|
| 13 |
scaler = dill.load(f)
|
| 14 |
return encoder, scaler
|
| 15 |
|
| 16 |
+
model = load_model()
|
| 17 |
+
encoder, scaler = load_preprocessing_components()
|
| 18 |
|
| 19 |
class InferenceData(BaseModel):
|
| 20 |
Age: float
|