Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add print_important_package_version log #24

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion llmc/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
from llmc.data import BaseDataset, BaseTokenizer
from llmc.eval import PerplexityEval
from llmc.models import *
from llmc.utils import check_config, mkdirs, seed_all
from llmc.utils import (check_config, mkdirs, print_important_package_version,
seed_all)
from llmc.utils.registry_factory import ALGO_REGISTRY, MODEL_REGISTRY


Expand Down Expand Up @@ -121,6 +122,8 @@ def main(config):
logger.info(f'args: {args}')
logger.info(f'config:\n{json.dumps(config, ensure_ascii=False, indent=4)}')

print_important_package_version()

seed_all(config.base.seed)

# mkdirs
Expand Down
3 changes: 2 additions & 1 deletion llmc/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from .utils import check_config, copy_files, mkdirs, seed_all
from .utils import (check_config, copy_files, mkdirs,
print_important_package_version, seed_all)
9 changes: 9 additions & 0 deletions llmc/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,12 @@ def copy_files(source_dir, target_dir, substring):
target_file = os.path.join(target_dir, filename)
shutil.copy(source_file, target_file)
logger.info(f'Copied {filename} to {target_dir}')


def print_important_package_version():
from importlib.metadata import version
logger.info(f"torch : {version('torch')}")
logger.info(f"transformers : {version('transformers')}")
logger.info(f"tokenizers : {version('tokenizers')}")
logger.info(f"huggingface-hub : {version('huggingface-hub')}")
logger.info(f"datasets : {version('datasets')}")
Loading