static async from_pretrained(pretrained_model_name_or_path, options) {

        const [config, components] = await Promise.all([
            // TODO:
            this.uses_processor_config
                ? getModelJSON(pretrained_model_name_or_path, PROCESSOR_NAME, true, options)
                : {},
            Promise.all(
                this.classes
                    .filter((cls) => cls in this)
                    .map(async (cls) => {
                        const component = await this[cls].from_pretrained(pretrained_model_name_or_path, options);
                        return [cls.replace(/_class$/, ''), component];
                    })
            ).then(Object.fromEntries)
        ]);

        return new this(config, components);
    }
Instantiate one of the processor classes of the library from a pretrained model.

The processor class to instantiate is selected based on the `image_processor_type` (or `feature_extractor_type`; legacy)
property of the config object (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)

@param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:
- A string, the *model id* of a pretrained processor hosted inside a model repo on huggingface.co.
  Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a
  user or organization name, like `dbmdz/bert-base-german-cased`.
- A path to a *directory* containing processor files, e.g., `./my_model_directory/`.
@param {PretrainedProcessorOptions} options Additional options for loading the processor.

@returns {Promise<Processor>} A new instance of the Processor class.