Spaces:
Sleeping
Sleeping
Hardik commited on
Commit ·
a435fdd
1
Parent(s): 84d0886
Pin sklearn to 1.3.2 for model compatibility
Browse files- Dockerfile +1 -1
- ml_service/app/services/model_loader.py +0 -2
- ml_service/requirements.txt +1 -1
Dockerfile
CHANGED
|
@@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y curl nginx supervisor && \
|
|
| 6 |
apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
RUN pip install --no-cache-dir fastapi==0.111.0 uvicorn==0.30.1 pydantic==2.7.4 \
|
| 9 |
-
pydantic-settings==2.3.4 numpy==1.26.4 pandas==2.2.2 scikit-learn==1.
|
| 10 |
scipy==1.13.1 nltk==3.8.1 tensorflow==2.16.1 keras==3.3.3 \
|
| 11 |
torch==2.3.1 transformers==4.41.2 joblib==1.4.2
|
| 12 |
|
|
|
|
| 6 |
apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
RUN pip install --no-cache-dir fastapi==0.111.0 uvicorn==0.30.1 pydantic==2.7.4 \
|
| 9 |
+
pydantic-settings==2.3.4 numpy==1.26.4 pandas==2.2.2 scikit-learn==1.3.2 \
|
| 10 |
scipy==1.13.1 nltk==3.8.1 tensorflow==2.16.1 keras==3.3.3 \
|
| 11 |
torch==2.3.1 transformers==4.41.2 joblib==1.4.2
|
| 12 |
|
ml_service/app/services/model_loader.py
CHANGED
|
@@ -85,8 +85,6 @@ class ModelManager:
|
|
| 85 |
if os.path.exists(vec_path) and os.path.exists(model_path):
|
| 86 |
self.lr_vectorizer = joblib.load(vec_path)
|
| 87 |
self.lr_model = joblib.load(model_path)
|
| 88 |
-
if not hasattr(self.lr_model, 'multi_class'):
|
| 89 |
-
self.lr_model.multi_class = 'ovr'
|
| 90 |
self.models_loaded["logistic_regression"] = True
|
| 91 |
except Exception as e:
|
| 92 |
print(f"Failed to load Logistic Regression: {e}")
|
|
|
|
| 85 |
if os.path.exists(vec_path) and os.path.exists(model_path):
|
| 86 |
self.lr_vectorizer = joblib.load(vec_path)
|
| 87 |
self.lr_model = joblib.load(model_path)
|
|
|
|
|
|
|
| 88 |
self.models_loaded["logistic_regression"] = True
|
| 89 |
except Exception as e:
|
| 90 |
print(f"Failed to load Logistic Regression: {e}")
|
ml_service/requirements.txt
CHANGED
|
@@ -4,7 +4,7 @@ pydantic==2.7.4
|
|
| 4 |
pydantic-settings==2.3.4
|
| 5 |
numpy==1.26.4
|
| 6 |
pandas==2.2.2
|
| 7 |
-
scikit-learn==1.
|
| 8 |
scipy==1.13.1
|
| 9 |
nltk==3.8.1
|
| 10 |
tensorflow==2.16.1
|
|
|
|
| 4 |
pydantic-settings==2.3.4
|
| 5 |
numpy==1.26.4
|
| 6 |
pandas==2.2.2
|
| 7 |
+
scikit-learn==1.3.2
|
| 8 |
scipy==1.13.1
|
| 9 |
nltk==3.8.1
|
| 10 |
tensorflow==2.16.1
|