winglian commited on
Commit
4313b1a
·
unverified ·
1 Parent(s): 7f17eff

Print versions (#1496)

Browse files

* print out dependency versions for easier debugging

* improve readability

Files changed (1) hide show
  1. src/axolotl/cli/__init__.py +15 -0
src/axolotl/cli/__init__.py CHANGED
@@ -24,6 +24,7 @@ from huggingface_hub import HfApi
24
  from huggingface_hub.utils import LocalTokenNotFoundError
25
  from transformers import GenerationConfig, TextIteratorStreamer, TextStreamer
26
  from transformers.utils import is_torch_bf16_gpu_available
 
27
 
28
  from axolotl.common.cli import TrainerCliArgs, load_model_and_tokenizer
29
  from axolotl.logging_config import configure_logging
@@ -62,6 +63,20 @@ def print_axolotl_text_art(suffix=None):
62
  if is_main_process():
63
  print(ascii_art)
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  def check_remote_config(config: Union[str, Path]):
67
  # Check if the config is a valid HTTPS URL to a .yml or .yaml file
 
24
  from huggingface_hub.utils import LocalTokenNotFoundError
25
  from transformers import GenerationConfig, TextIteratorStreamer, TextStreamer
26
  from transformers.utils import is_torch_bf16_gpu_available
27
+ from transformers.utils.import_utils import _is_package_available
28
 
29
  from axolotl.common.cli import TrainerCliArgs, load_model_and_tokenizer
30
  from axolotl.logging_config import configure_logging
 
63
  if is_main_process():
64
  print(ascii_art)
65
 
66
+ print_dep_versions()
67
+
68
+
69
+ def print_dep_versions():
70
+ packages = ["accelerate", "peft", "transformers", "trl", "torch", "bitsandbytes"]
71
+ max_len = max(len(pkg) for pkg in packages)
72
+ if is_main_process():
73
+ print("*" * 40)
74
+ print("**** Axolotl Dependency Versions *****")
75
+ for pkg in packages:
76
+ version = _is_package_available(pkg, return_version=True)
77
+ print(f"{pkg: >{max_len}}: {version[1]: <15}")
78
+ print("*" * 40)
79
+
80
 
81
  def check_remote_config(config: Union[str, Path]):
82
  # Check if the config is a valid HTTPS URL to a .yml or .yaml file