Skip to content

Commit

Permalink
Print versions (#1496)
Browse files Browse the repository at this point in the history
* print out dependency versions for easier debugging

* improve readability
  • Loading branch information
winglian authored Apr 9, 2024
1 parent 7f17eff commit 4313b1a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/axolotl/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from huggingface_hub.utils import LocalTokenNotFoundError
from transformers import GenerationConfig, TextIteratorStreamer, TextStreamer
from transformers.utils import is_torch_bf16_gpu_available
from transformers.utils.import_utils import _is_package_available

from axolotl.common.cli import TrainerCliArgs, load_model_and_tokenizer
from axolotl.logging_config import configure_logging
Expand Down Expand Up @@ -62,6 +63,20 @@ def print_axolotl_text_art(suffix=None):
if is_main_process():
print(ascii_art)

print_dep_versions()


def print_dep_versions():
packages = ["accelerate", "peft", "transformers", "trl", "torch", "bitsandbytes"]
max_len = max(len(pkg) for pkg in packages)
if is_main_process():
print("*" * 40)
print("**** Axolotl Dependency Versions *****")
for pkg in packages:
version = _is_package_available(pkg, return_version=True)
print(f"{pkg: >{max_len}}: {version[1]: <15}")
print("*" * 40)


def check_remote_config(config: Union[str, Path]):
# Check if the config is a valid HTTPS URL to a .yml or .yaml file
Expand Down

0 comments on commit 4313b1a

Please sign in to comment.