class_docstr: Base class for all schedulers.
  
  [`SchedulerMixin`] contains common functions shared by all schedulers such as general loading and saving
  functionalities.
  
  [`ConfigMixin`] takes care of storing the configuration attributes (like `num_train_timesteps`) that are passed to
  the scheduler's `__init__` function, and the attributes can be accessed by `scheduler.config.num_train_timesteps`.
  
  Class attributes:
      - **_compatibles** (`List[str]`) -- A list of scheduler classes that are compatible with the parent scheduler
        class. Use [`~ConfigMixin.from_config`] to load a different compatible scheduler class (should be overridden
        by parent class).
class_docstr_tok: ["Base","class","for","all","schedulers",".","[","`","SchedulerMixin","`","]","contains","common","functions","shared","by","all","schedulers","such","as","general","loading","and","saving","functionalities",".","[","`","ConfigMixin","`","]","takes","care","of","storing","the","configuration","attributes","(","like","`","num_train_timesteps","`",")","that","are","passed","to","the","scheduler","'s","`","__init__","`","function",",","and","the","attributes","can","be","accessed","by","`","scheduler.config.num_train_timesteps","`",".","Class","attributes",":","-","*","*","_compatibles","*","*","(","`","List","[","str","]","`",")","--","A","list","of","scheduler","classes","that","are","compatible","with","the","parent","scheduler","class",".","Use","[","`","~ConfigMixin.from_config","`","]","to","load","a","different","compatible","scheduler","class","(","should","be","overridden","by","parent","class",")","."]
docstr: Instantiate a scheduler from a pre-defined JSON configuration file in a local directory or Hub repository.
  
  Parameters:
      pretrained_model_name_or_path (`str` or `os.PathLike`, *optional*):
          Can be either:
  
              - A string, the *model id* (for example `google/ddpm-celebahq-256`) of a pretrained model hosted on
                the Hub.
              - A path to a *directory* (for example `./my_model_directory`) containing the scheduler
                configuration saved with [`~SchedulerMixin.save_pretrained`].
      subfolder (`str`, *optional*):
          The subfolder location of a model file within a larger model repository on the Hub or locally.
      return_unused_kwargs (`bool`, *optional*, defaults to `False`):
          Whether kwargs that are not consumed by the Python class should be returned or not.
      cache_dir (`Union[str, os.PathLike]`, *optional*):
          Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
          is not used.
      force_download (`bool`, *optional*, defaults to `False`):
          Whether or not to force the (re-)download of the model weights and configuration files, overriding the
          cached versions if they exist.
      resume_download (`bool`, *optional*, defaults to `False`):
          Whether or not to resume downloading the model weights and configuration files. If set to `False`, any
          incompletely downloaded files are deleted.
      proxies (`Dict[str, str]`, *optional*):
          A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
          'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
      output_loading_info(`bool`, *optional*, defaults to `False`):
          Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.
      local_files_only(`bool`, *optional*, defaults to `False`):
          Whether to only load local model weights and configuration files or not. If set to `True`, the model
          won't be downloaded from the Hub.
      use_auth_token (`str` or *bool*, *optional*):
          The token to use as HTTP bearer authorization for remote files. If `True`, the token generated from
          `diffusers-cli login` (stored in `~/.huggingface`) is used.
      revision (`str`, *optional*, defaults to `"main"`):
          The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
          allowed by Git.
  
  <Tip>
  
  To use private or [gated models](https://huggingface.co/docs/hub/models-gated#gated-models), log-in with
  `huggingface-cli login`. You can also activate the special
  ["offline-mode"](https://huggingface.co/diffusers/installation.html#offline-mode) to use this method in a
  firewalled environment.
  
  </Tip>
docstr_tok: ["Instantiate","a","scheduler","from","a","pre-defined","JSON","configuration","file","in","a","local","directory","or","Hub","repository",".","Parameters",":","pretrained_model_name_or_path","(","`","str","`","or","`","os.PathLike","`",",","*","optional","*",")",":","Can","be","either",":","-","A","string",",","the","*","model","id","*","(","for","example","`","google\/ddpm-celebahq-256","`",")","of","a","pretrained","model","hosted","on","the","Hub",".","-","A","path","to","a","*","directory","*","(","for","example","`",".\/my_model_directory","`",")","containing","the","scheduler","configuration","saved","with","[","`","~SchedulerMixin.save_pretrained","`","]",".","subfolder","(","`","str","`",",","*","optional","*",")",":","The","subfolder","location","of","a","model","file","within","a","larger","model","repository","on","the","Hub","or","locally",".","return_unused_kwargs","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","kwargs","that","are","not","consumed","by","the","Python","class","should","be","returned","or","not",".","cache_dir","(","`","Union","[","str",",","os.PathLike","]","`",",","*","optional","*",")",":","Path","to","a","directory","where","a","downloaded","pretrained","model","configuration","is","cached","if","the","standard","cache","is","not","used",".","force_download","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","to","force","the","(","re-",")","download","of","the","model","weights","and","configuration","files",",","overriding","the","cached","versions","if","they","exist",".","resume_download","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","to","resume","downloading","the","model","weights","and","configuration","files",".","If","set","to","`","False","`",",","any","incompletely","downloaded","files","are","deleted",".","proxies","(","`","Dict","[","str",",","str","]","`",",","*","optional","*",")",":","A","dictionary","of","proxy","servers","to","use","by","protocol","or","endpoint",",","for","example",",","`","{","'http","'",":","'foo.bar:3128","'",",","'http",":","\/\/hostname","'",":","'foo.bar:4012","'","}","`",".","The","proxies","are","used","on","each","request",".","output_loading_info","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","to","also","return","a","dictionary","containing","missing","keys",",","unexpected","keys","and","error","messages",".","local_files_only","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","to","only","load","local","model","weights","and","configuration","files","or","not",".","If","set","to","`","True","`",",","the","model","wo","n't","be","downloaded","from","the","Hub",".","use_auth_token","(","`","str","`","or","*","bool","*",",","*","optional","*",")",":","The","token","to","use","as","HTTP","bearer","authorization","for","remote","files",".","If","`","True","`",",","the","token","generated","from","`","diffusers-cli","login","`","(","stored","in","`","~\/.huggingface","`",")","is","used",".","revision","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","main","''","`",")",":","The","specific","model","version","to","use",".","It","can","be","a","branch","name",",","a","tag","name",",","a","commit","id",",","or","any","identifier","allowed","by","Git",".","<","Tip",">","To","use","private","or","[","gated","models","]","(","https",":","\/\/huggingface.co\/docs\/hub\/models-gated","#","gated-models",")",",","log-in","with","`","huggingface-cli","login","`",".","You","can","also","activate","the","special","[","``","offline-mode","''","]","(","https",":","\/\/huggingface.co\/diffusers\/installation.html","#","offline-mode",")","to","use","this","method","in","a","firewalled","environment",".","<","\/Tip",">"]
code: def from_pretrained(
      cls,
      pretrained_model_name_or_path: Optional[
          Union[str, os.PathLike]
      ] = None,
      subfolder: Optional[str] = None,
      return_unused_kwargs=False,
      **kwargs,
  ):
      r"""
      Instantiate a scheduler from a pre-defined JSON configuration file in a local directory or Hub repository.
  
      Parameters:
          pretrained_model_name_or_path (`str` or `os.PathLike`, *optional*):
              Can be either:
  
                  - A string, the *model id* (for example `google/ddpm-celebahq-256`) of a pretrained model hosted on
                    the Hub.
                  - A path to a *directory* (for example `./my_model_directory`) containing the scheduler
                    configuration saved with [`~SchedulerMixin.save_pretrained`].
          subfolder (`str`, *optional*):
              The subfolder location of a model file within a larger model repository on the Hub or locally.
          return_unused_kwargs (`bool`, *optional*, defaults to `False`):
              Whether kwargs that are not consumed by the Python class should be returned or not.
          cache_dir (`Union[str, os.PathLike]`, *optional*):
              Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
              is not used.
          force_download (`bool`, *optional*, defaults to `False`):
              Whether or not to force the (re-)download of the model weights and configuration files, overriding the
              cached versions if they exist.
          resume_download (`bool`, *optional*, defaults to `False`):
              Whether or not to resume downloading the model weights and configuration files. If set to `False`, any
              incompletely downloaded files are deleted.
          proxies (`Dict[str, str]`, *optional*):
              A dictionary of proxy servers to use by protocol or endpoint, for example, `{'http': 'foo.bar:3128',
              'http://hostname': 'foo.bar:4012'}`. The proxies are used on each request.
          output_loading_info(`bool`, *optional*, defaults to `False`):
              Whether or not to also return a dictionary containing missing keys, unexpected keys and error messages.
          local_files_only(`bool`, *optional*, defaults to `False`):
              Whether to only load local model weights and configuration files or not. If set to `True`, the model
              won't be downloaded from the Hub.
          use_auth_token (`str` or *bool*, *optional*):
              The token to use as HTTP bearer authorization for remote files. If `True`, the token generated from
              `diffusers-cli login` (stored in `~/.huggingface`) is used.
          revision (`str`, *optional*, defaults to `"main"`):
              The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
              allowed by Git.
  
      <Tip>
  
      To use private or [gated models](https://huggingface.co/docs/hub/models-gated#gated-models), log-in with
      `huggingface-cli login`. You can also activate the special
      ["offline-mode"](https://huggingface.co/diffusers/installation.html#offline-mode) to use this method in a
      firewalled environment.
  
      </Tip>
  
      """
      config, kwargs, commit_hash = cls.load_config(
          pretrained_model_name_or_path=pretrained_model_name_or_path,
          subfolder=subfolder,
          return_unused_kwargs=True,
          return_commit_hash=True,
          **kwargs,
      )
      return cls.from_config(
          config, return_unused_kwargs=return_unused_kwargs, **kwargs
      )
  
file_path: llmga/llmga/diffusers/src/diffusers/schedulers/scheduling_utils.py
imports: import importlib
  import os
  from dataclasses import dataclass
  from enum import Enum
  from typing import Optional, Union
  import torch
  from ..utils import BaseOutput, PushToHubMixin
label_desc: Use image node_id 1 for calling the SchedulerMixin obj's underlying member method code with example usage: obj.from_pretrained(cls, pretrained_model_name_or_path, subfolder, return_unused_kwargs) and returns: cls