Spaces:
Sleeping
Sleeping
Upload data_pipeline/inference.py with huggingface_hub
Browse files
data_pipeline/inference.py
CHANGED
|
@@ -56,7 +56,7 @@ class CopilotModels:
|
|
| 56 |
def load(self):
|
| 57 |
if self._loaded:
|
| 58 |
return
|
| 59 |
-
print("Loading Copilot models
|
| 60 |
|
| 61 |
self.failure_model = joblib.load(ARTIFACTS / "failure_predictor.pkl")
|
| 62 |
self.scaler = joblib.load(ARTIFACTS / "feature_scaler.pkl")
|
|
@@ -69,7 +69,7 @@ class CopilotModels:
|
|
| 69 |
|
| 70 |
self._load_rag()
|
| 71 |
self._loaded = True
|
| 72 |
-
print("
|
| 73 |
|
| 74 |
def _load_rag(self):
|
| 75 |
try:
|
|
@@ -83,9 +83,9 @@ class CopilotModels:
|
|
| 83 |
settings=Settings(anonymized_telemetry=False),
|
| 84 |
)
|
| 85 |
self._collection = client.get_collection("productivity_coach")
|
| 86 |
-
print(f"
|
| 87 |
except Exception as e:
|
| 88 |
-
print(f"
|
| 89 |
self._collection = None
|
| 90 |
self._embedder = None
|
| 91 |
|
|
|
|
| 56 |
def load(self):
|
| 57 |
if self._loaded:
|
| 58 |
return
|
| 59 |
+
print("Loading Copilot models...")
|
| 60 |
|
| 61 |
self.failure_model = joblib.load(ARTIFACTS / "failure_predictor.pkl")
|
| 62 |
self.scaler = joblib.load(ARTIFACTS / "feature_scaler.pkl")
|
|
|
|
| 69 |
|
| 70 |
self._load_rag()
|
| 71 |
self._loaded = True
|
| 72 |
+
print("Loaded all models.")
|
| 73 |
|
| 74 |
def _load_rag(self):
|
| 75 |
try:
|
|
|
|
| 83 |
settings=Settings(anonymized_telemetry=False),
|
| 84 |
)
|
| 85 |
self._collection = client.get_collection("productivity_coach")
|
| 86 |
+
print(f"RAG vector store loaded ({self._collection.count()} chunks)")
|
| 87 |
except Exception as e:
|
| 88 |
+
print(f"RAG not available: {e}. Persuasion will work without retrieval context.")
|
| 89 |
self._collection = None
|
| 90 |
self._embedder = None
|
| 91 |
|