Xunjunaa commited on
Commit
8a9f39d
·
1 Parent(s): 085d867

fix: /health 也自报 models(标准块), hub 保活快照捷径不再丢目录

Browse files
Files changed (1) hide show
  1. server.py +6 -0
server.py CHANGED
@@ -1194,9 +1194,15 @@ async def status_page():
1194
  async def health():
1195
  """HF Space 探活端点。带快照字段子集(与 /api/stats 同名同构, 见 stats_lite) ——
1196
  CF keeper 从这里直接落快照, 每空间省一次 /api/stats 子请求。"""
 
 
 
 
 
1197
  return {"ok": pool.ready, "ready": pool.ready,
1198
  "uptime_s": int(time.time() - _started_at),
1199
  "load": {"saturation": _load_saturation()},
 
1200
  **pool.stats_lite()}
1201
 
1202
 
 
1194
  async def health():
1195
  """HF Space 探活端点。带快照字段子集(与 /api/stats 同名同构, 见 stats_lite) ——
1196
  CF keeper 从这里直接落快照, 每空间省一次 /api/stats 子请求。"""
1197
+ @app.get("/health")
1198
+ async def health():
1199
+ """HF Space 探活端点。带快照字段子集(与 /api/stats 同名同构, 见 stats_lite)
1200
+ —— CF keeper 从这里直接落快照, 每空间省一次 /api/stats 子请求;
1201
+ models 也自报(hub 目录路由的动态成员 + /v1/models 聚合数据源)。"""
1202
  return {"ok": pool.ready, "ready": pool.ready,
1203
  "uptime_s": int(time.time() - _started_at),
1204
  "load": {"saturation": _load_saturation()},
1205
+ "models": await _stats_models(),
1206
  **pool.stats_lite()}
1207
 
1208