fastvideo.v1.models.hf_transformer_utils#

Utilities for Huggingface Transformers.

Module Contents#

Functions#

attach_additional_stop_token_ids

check_gguf_file

Check if the file is a GGUF model.

download_from_hf

get_diffusers_config

Gets a configuration for the given diffusers model.

get_hf_config

Data#

API#

fastvideo.v1.models.hf_transformer_utils.CONTEXT_LENGTH_KEYS[source]#

[‘max_sequence_length’, ‘seq_length’, ‘max_seq_len’, ‘model_max_length’, ‘max_position_embeddings’]

fastvideo.v1.models.hf_transformer_utils.attach_additional_stop_token_ids(tokenizer)[source]#
fastvideo.v1.models.hf_transformer_utils.check_gguf_file(model: Union[str, os.PathLike]) bool[source]#

Check if the file is a GGUF model.

fastvideo.v1.models.hf_transformer_utils.download_from_hf(model_path: str)[source]#
fastvideo.v1.models.hf_transformer_utils.get_diffusers_config(model: str, fastvideo_args: Optional[dict] = None) Dict[str, Any][source]#

Gets a configuration for the given diffusers model.

Parameters:
  • model – The model name or path.

  • fastvideo_args – Optional inference arguments to override in the config.

Returns:

The loaded configuration.

fastvideo.v1.models.hf_transformer_utils.get_hf_config(model: str, trust_remote_code: bool, revision: Optional[str] = None, model_override_args: Optional[dict] = None, **kwargs)[source]#