Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#378 Feature/sg 281 add kd notebook

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:feature/SG-281-add_kd_notebook
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  1. import logging
  2. import os
  3. from os import environ
  4. import pkg_resources
  5. try:
  6. PKG_CHECKPOINTS_DIR = pkg_resources.resource_filename("checkpoints", "")
  7. except Exception:
  8. os.makedirs(os.path.join(os.getcwd(), "checkpoints"), exist_ok=True)
  9. PKG_CHECKPOINTS_DIR = os.path.join(os.getcwd(), "checkpoints")
  10. AWS_ENV_NAME = environ.get("ENVIRONMENT_NAME")
  11. AWS_ENVIRONMENTS = ["development", "staging", "production"]
  12. if AWS_ENV_NAME not in AWS_ENVIRONMENTS:
  13. if AWS_ENV_NAME is None:
  14. if AWS_ENV_NAME not in AWS_ENVIRONMENTS:
  15. print(
  16. f"You did not mention an AWS environment."
  17. f'You can set the environment variable ENVIRONMENT_NAME with one of the values: {",".join(AWS_ENVIRONMENTS)}'
  18. )
  19. else:
  20. print(
  21. f'Bad AWS environment name: {AWS_ENV_NAME}. Please set an environment variable named ENVIRONMENT_NAME '
  22. f'with one of the values: {",".join(AWS_ENVIRONMENTS)}'
  23. )
  24. # Controlling the default logging level via environment variable
  25. DEFAULT_LOGGING_LEVEL = environ.get("LOG_LEVEL", "INFO").upper()
  26. logging.basicConfig(
  27. level=DEFAULT_LOGGING_LEVEL
  28. ) # Set the default level for all libraries - including 3rd party packages
  29. DDP_LOCAL_RANK = -1
  30. INIT_TRAINER = False
Discard
Tip!

Press p or to see the previous file or, n or to see the next file