Refactor model response inclusion to only include groups with multiple models; update model removal logic to accept hash value. See #221

This commit is contained in:
Will Miao
2025-06-11 19:52:44 +08:00
parent e0d9880b32
commit eb01ad3af9
6 changed files with 48 additions and 25 deletions

View File

@@ -1209,7 +1209,7 @@ class ApiRoutes:
if primary_model:
group["models"].insert(0, self._format_lora_response(primary_model))
if group["models"]: # Only include if we found models
if len(group["models"]) > 1: # Only include if we found multiple models
result.append(group)
return web.json_response({

View File

@@ -735,7 +735,7 @@ class CheckpointsRoutes:
if primary_model:
group["models"].insert(0, self._format_checkpoint_response(primary_model))
if group["models"]:
if len(group["models"]) > 1: # Only include if we found multiple models
result.append(group)
return web.json_response({