cellmap_flow.dashboard.routes.model_resolve

POST /api/models/resolve: a model entry from whatever reference the user pasted; POST /api/models/add: run such an entry.

The body is {"ref": ..., "name": ..., "voxel_size": ...} (only ref is required; voxel_size is one number, one per axis, or “8,8,8”). The answer is models.resolve’s Resolved:

{"success": true, "type": "fly", "params": {"checkpoint_path": ...},
 "name": "run07_432000", "env": "fly", "how": "a fly_organelles training checkpoint",
 "needs": [], "notes": [...]}

type, params and name are the model entry, which the model form submits once the user has given what needs lists. Nothing is built or launched here. A reference that resolves to nothing, or to a model cellmap-flow cannot serve, is a 400 with {"success": false, "error": ...}. resolve_request is that resolve, which the Finetune tab’s ranking adds a model with too (POST /api/finetune/rank/add, routes/finetune/rank_routes.py).

Attributes

logger

model_resolve_bp

Classes

ResolveModel

What the user pasted, and optionally the model's name and voxel size.

AddModel

A model entry to run: type, its parameters and name, as resolve

Functions

resolve_request(data)

(resolved, error): what the reference of data, a ResolveModel's

resolve_model()

add_model()

Build the entry and start its server, in its environment.

Module Contents

cellmap_flow.dashboard.routes.model_resolve.logger
cellmap_flow.dashboard.routes.model_resolve.model_resolve_bp
class cellmap_flow.dashboard.routes.model_resolve.ResolveModel(/, **data: Any)

What the user pasted, and optionally the model’s name and voxel size.

ref: Annotated[str, _required('ref', strip=True)]
name: str | None = None
voxel_size: Any = None
cellmap_flow.dashboard.routes.model_resolve.resolve_request(data)

(resolved, error): what the reference of data, a ResolveModel’s body, resolves to (models.resolve’s Resolved) and None; or None and the 400 answer saying why it resolves to nothing, or why the body is not one. Add a model’s resolve, here and in the Finetune tab’s ranking.

cellmap_flow.dashboard.routes.model_resolve.resolve_model()
class cellmap_flow.dashboard.routes.model_resolve.AddModel(/, **data: Any)

A model entry to run: type, its parameters and name, as resolve answers them with what needs asked filled in.

entry: dict
cellmap_flow.dashboard.routes.model_resolve.add_model()

Build the entry and start its server, in its environment.

The model joins the session’s models and jobs like one Submit started, so it stays running while it is ticked on the Models tab (the page adds a ticked box for it) and is stopped when unticked. A 400 names what is wrong with the entry; a 409, a model of that name already running.