__init__.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Copyright 2020 The HuggingFace Team. All rights reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. __version__ = "1.12.0"
  15. from .accelerator import Accelerator
  16. from .big_modeling import (
  17. cpu_offload,
  18. cpu_offload_with_hook,
  19. disk_offload,
  20. dispatch_model,
  21. init_empty_weights,
  22. init_on_device,
  23. load_checkpoint_and_dispatch,
  24. )
  25. from .data_loader import skip_first_batches
  26. from .inference import prepare_pippy
  27. from .launchers import debug_launcher, notebook_launcher
  28. from .parallelism_config import ParallelismConfig
  29. from .state import PartialState
  30. from .utils import (
  31. AutocastKwargs,
  32. DataLoaderConfiguration,
  33. DDPCommunicationHookType,
  34. DeepSpeedPlugin,
  35. DistributedDataParallelKwargs,
  36. DistributedType,
  37. FullyShardedDataParallelPlugin,
  38. GradScalerKwargs,
  39. InitProcessGroupKwargs,
  40. ProfileKwargs,
  41. find_executable_batch_size,
  42. infer_auto_device_map,
  43. is_rich_available,
  44. load_checkpoint_in_model,
  45. synchronize_rng_states,
  46. )
  47. if is_rich_available():
  48. from .utils import rich