tagger

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultModelFile    = "model.onnx"
	DefaultTagsFile     = "tags.csv"
	DefaultTextTagsFile = "tags.txt"
	// DefaultConfidenceThreshold is applied to taggers discovered on disk
	// that do not yet have a TOML entry with an explicit threshold.
	DefaultConfidenceThreshold = 0.4
)

Default filenames for a tagger subfolder. Either can be overridden per tagger via its TOML entry. When a subfolder has neither default, a lone .onnx / .csv / .txt is picked automatically.

Variables

This section is empty.

Functions

func CheckCUDAAvailable

func CheckCUDAAvailable() error

CheckCUDAAvailable always errors in the no-tagger build because inference is compiled out; the tagger-build variant has the real probe.

func IsAvailable

func IsAvailable(_ *config.Config) bool

IsAvailable returns false when built without the tagger build tag.

func RunWithTaggers

func RunWithTaggers(_ context.Context, _ *db.DB, _ *config.Config, _ []int64, _ []TaggerStatus, _ *jobs.Manager, _ bool) error

RunWithTaggers is a no-op stub matching the tagger-build signature.

func UnavailableReason added in v1.2.1

func UnavailableReason(_ *config.Config) string

UnavailableReason explains why auto-tagging cannot run in this build. The string mirrors the one Settings → Auto-Tagger shows so flashes on the detail page stay consistent with what the settings page claims.

Types

type TaggerStatus

type TaggerStatus struct {
	config.TaggerInstance
	Available bool
	Reason    string // populated when Available is false
}

TaggerStatus pairs a configured tagger with its runtime availability so the settings UI can show why a tagger is active or inactive.

func AvailableTaggers

func AvailableTaggers(cfg *config.Config) []TaggerStatus

AvailableTaggers lists the auto-taggers that could run, along with the reason each is or isn't active. The noop build reports every configured tagger as unavailable because inference is disabled at build time.

func DiscoverTaggers

func DiscoverTaggers(cfg *config.Config) []TaggerStatus

DiscoverTaggers lists the tagger subfolders under paths.model_path and merges them with the configured list from cfg.Tagger.Taggers. An entry exists in the result for every subfolder present on disk OR every configured tagger (so users can see leftover config even if the folder is gone). Results are sorted by Name.

func EnabledTaggers

func EnabledTaggers(cfg *config.Config) []TaggerStatus

EnabledTaggers returns the taggers that are both enabled in config and have their files present on disk. Returns nil on a noop build so UI affordances that offer to run the tagger stay hidden on a binary that cannot run one.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL