flow_inference.model_handling.ModelManager

class flow_inference.model_handling.ModelManager[source]

Load TrOCR models and processors on the best available device.

The manager selects CUDA, Apple MPS, or CPU as the inference device and provides helpers for loading Hugging Face vision-encoder-decoder models and TrOCR processors.

__init__()[source]

Initialize the model manager and select an inference device.

Methods

__init__()

Initialize the model manager and select an inference device.

load_model(model_name)

Load a TrOCR-compatible vision-encoder-decoder model.

load_processor(processor_name)

Load a TrOCR processor with fast-tokenizer fallback.