Conversation
Wire per_tag_thresholds/per_tag_column per request through TagImageBody/TagJobOptions into TaggingThresholds, resolve the per-tag dict per request, isolate cache slots per toggle+column with unknown-column collapse, validate column values (400), refresh thresholds on swap rollback and set_active_tagger.
Forward per-tag options in tagImage/startTagJob/fetch/preview, pass through single/batch actions, dynamic column dropdown from per_tag_columns with reset on unsupported models, Tags tab fetch and preview carry per-tag, re-fetch on swap settled via SSE.
Cover CSV parsing edge cases, per-tag override/fallback semantics, options resolution, cache-key divergence and unknown-column collapse, get_tag_result filtering, active-endpoint capability, body validation, and rollback refresh.
itterative
reviewed
Sep 13, 2026
| per_tag_enabled = None if per_tag_raw is None else per_tag_raw.lower() in ("true", "1", "yes") | ||
| per_tag_column = request.args.get("per_tag_column") | ||
| if per_tag_column is not None: | ||
| from yadc.taggers.onnx import PER_TAG_THRESHOLD_COLUMNS as _PER_TAG_COLS |
Owner
There was a problem hiding this comment.
hmm, might be good to have this outside of onnx so it doesn't have to import heavy. might be good to move these to onnx_preprocess ig since it already has the profiles
itterative
reviewed
Sep 13, 2026
| let sawSwapTransition = $state(false); | ||
|
|
||
| async function fetchPerTagSupport(signal?: AbortSignal, retries = 3) { | ||
| for (let i = 0; i < retries; i++) { |
Owner
There was a problem hiding this comment.
abort should be handled both in the loop and in the catch
itterative
reviewed
Sep 13, 2026
| return; | ||
| } catch { | ||
| if (i < retries - 1) { | ||
| await new Promise((r) => setTimeout(r, 2000)); |
Owner
There was a problem hiding this comment.
there's a sleep promise in async.ts
itterative
reviewed
Sep 13, 2026
| sawSwapTransition = false; | ||
| fetchPerTagSupport(); | ||
| }; | ||
| window.addEventListener(TAGGER_SWAPPED_EVENT, handler); |
Owner
There was a problem hiding this comment.
prefer subscribing to the active tagger rather than using an event here. though you'll need to move it to a store. there's no active tagger event on the backend I see, I missed adding that
onnx pulls numpy and the session machinery; the column allowlist and CSV loader need neither. Top-level imports everywhere, no more lazy dance in validators and refresh.
Capability derives from a shared store re-fetched on tagger_status settle (cross-tab, survives long HF downloads). Drops TAGGER_SWAPPED_EVENT and the abort-unaware retry loop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this wires up the per-tag threshold toggle.
how it works: if the model's csv has best_threshold / best_recall columns, the tag settings show a checkbox to use those instead of the three sliders, plus a dropdown to pick which column. wd models don't have the columns so nothing changes for them.
i tested it with the unit tests (csv parsing, threshold override, cache keys) and clicked through the toggle + swap in the ui. ruff, eslint and svelte-check are clean.
two things to know: