cellmap_flow.dashboard.routes.finetune.training

Training jobs: submitting one, restarting it, and following it.

Routes: - POST /api/finetune/submit: a job for a model over a session’s corrections,

its paint first carried onto the model’s grid when the session’s volume is on another (annotation_core.grid_change, carry_onto_model: what Use this model does), which the answer says (carried, note);

  • POST /api/finetune/job/<job_id>/restart: the next iteration, with new settings;

  • GET /api/finetune/jobs: every job, including those a dashboard before this one started (they are looked for first);

  • GET /api/finetune/job/<job_id>/status and .../logs;

  • GET /api/finetune/job/<job_id>/logs/stream: the log as server-sent events;

  • POST /api/finetune/job/<job_id>/cancel and .../stop-early.

The job list and a job’s status bind Shift+R in the viewer, which restarts the job the Finetune tab follows (the last whose status it asked for) with the tab’s settings: the status answer carries the presses (restart_requests) for the tab to act on, and the restart route says in the viewer’s status bar how it answered one (restart_key).

Attributes

logger

Functions

get_finetuning_jobs()

get_job_status(job_id)

get_job_logs(job_id)

submit_finetuning()

stream_job_logs(job_id)

Server-sent log stream.

cancel_job(job_id)

stop_training_early(job_id)

restart_finetuning_job(job_id)

Module Contents

cellmap_flow.dashboard.routes.finetune.training.logger
cellmap_flow.dashboard.routes.finetune.training.get_finetuning_jobs()
cellmap_flow.dashboard.routes.finetune.training.get_job_status(job_id)
cellmap_flow.dashboard.routes.finetune.training.get_job_logs(job_id)
cellmap_flow.dashboard.routes.finetune.training.submit_finetuning()
cellmap_flow.dashboard.routes.finetune.training.stream_job_logs(job_id)

Server-sent log stream.

Every block of lines carries id: <byte offset>, the position in the log after it, and a (re)connection resumes from the client’s Last-Event-ID – which EventSource sends by itself when it reconnects – or from ?offset=. The stream ends with event: done once the job is finished. It used to send the whole log on every connection and just stop at the end, so the browser’s automatic reconnect replayed the whole log, plus “=== Training COMPLETED ===”, every few seconds for as long as the page stayed open.

cellmap_flow.dashboard.routes.finetune.training.cancel_job(job_id)
cellmap_flow.dashboard.routes.finetune.training.stop_training_early(job_id)
cellmap_flow.dashboard.routes.finetune.training.restart_finetuning_job(job_id)