Upload inference_server.py with huggingface_hub
Browse files- inference_server.py +6 -3
inference_server.py
CHANGED
|
@@ -238,14 +238,17 @@ def predict_bottleneck_risk(req: BottleneckRequest):
|
|
| 238 |
complexity_score = req.constraint_complexity * tc_log
|
| 239 |
hours_ratio = req.hours_logged / max(req.estimated_hours, 1)
|
| 240 |
stage_idx = STAGE_IDX.get(req.current_stage, 1)
|
|
|
|
|
|
|
| 241 |
|
| 242 |
features = np.array([[
|
| 243 |
tech_enc, type_enc, priority_enc, tc_log,
|
| 244 |
int(req.has_dependencies), req.num_dependencies,
|
| 245 |
req.constraint_complexity, req.estimated_hours, req.hours_logged,
|
| 246 |
-
|
| 247 |
-
req.lvs_mismatches_total, stage_idx,
|
| 248 |
-
req.engineer_skill_factor,
|
|
|
|
| 249 |
]])
|
| 250 |
|
| 251 |
risk_idx = bottleneck_model.predict(features)[0]
|
|
|
|
| 238 |
complexity_score = req.constraint_complexity * tc_log
|
| 239 |
hours_ratio = req.hours_logged / max(req.estimated_hours, 1)
|
| 240 |
stage_idx = STAGE_IDX.get(req.current_stage, 1)
|
| 241 |
+
hours_budget_pct = req.hours_logged / max(req.estimated_hours, 1) * 100
|
| 242 |
+
stage_velocity = req.hours_logged / max(stage_idx, 1)
|
| 243 |
|
| 244 |
features = np.array([[
|
| 245 |
tech_enc, type_enc, priority_enc, tc_log,
|
| 246 |
int(req.has_dependencies), req.num_dependencies,
|
| 247 |
req.constraint_complexity, req.estimated_hours, req.hours_logged,
|
| 248 |
+
req.drc_iterations, req.drc_violations_total,
|
| 249 |
+
req.lvs_mismatches_total, stage_idx,
|
| 250 |
+
req.engineer_skill_factor, complexity_score,
|
| 251 |
+
hours_budget_pct, stage_velocity
|
| 252 |
]])
|
| 253 |
|
| 254 |
risk_idx = bottleneck_model.predict(features)[0]
|