Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ from pydantic import BaseModel
|
|
| 3 |
import joblib
|
| 4 |
import numpy as np
|
| 5 |
from fastapi.middleware.cors import CORSMiddleware
|
| 6 |
-
import pandas as pd #
|
| 7 |
|
| 8 |
app = FastAPI(title="Multi-Class Web Data Classifier API")
|
| 9 |
|
|
@@ -29,7 +29,7 @@ class InputData(BaseModel):
|
|
| 29 |
|
| 30 |
# Load model and label encoder
|
| 31 |
try:
|
| 32 |
-
model = joblib.load("trained_lightgbm_model.
|
| 33 |
label_encoder = joblib.load("label_encoder.pkl")
|
| 34 |
print("Model and Label Encoder loaded successfully.")
|
| 35 |
except Exception as e:
|
|
|
|
| 3 |
import joblib
|
| 4 |
import numpy as np
|
| 5 |
from fastapi.middleware.cors import CORSMiddleware
|
| 6 |
+
import pandas as pd # You might need this if you decide to preprocess raw input in the API
|
| 7 |
|
| 8 |
app = FastAPI(title="Multi-Class Web Data Classifier API")
|
| 9 |
|
|
|
|
| 29 |
|
| 30 |
# Load model and label encoder
|
| 31 |
try:
|
| 32 |
+
model = joblib.load("trained_lightgbm_model.pkl")
|
| 33 |
label_encoder = joblib.load("label_encoder.pkl")
|
| 34 |
print("Model and Label Encoder loaded successfully.")
|
| 35 |
except Exception as e:
|