Skip to content

Commit

Permalink
Merge branch 'main' into more-registry-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dakinggg authored Jul 31, 2024
2 parents 3e1150d + c9d09ce commit dbbe3c0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions llmfoundry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
tokenizers,
utils,
)
from llmfoundry._version import __version__
from llmfoundry.data import StreamingFinetuningDataset, StreamingTextDataset
from llmfoundry.eval import InContextLearningDataset, InContextLearningMetric
from llmfoundry.models.hf import ComposerHFCausalLM
Expand All @@ -63,6 +64,7 @@
from llmfoundry.optim import DecoupledLionW

__all__ = [
'__version__',
'StreamingFinetuningDataset',
'StreamingTextDataset',
'InContextLearningDataset',
Expand All @@ -87,5 +89,3 @@
'tokenizers',
'utils',
]

__version__ = '0.11.0.dev0'
6 changes: 6 additions & 0 deletions llmfoundry/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright 2024 MosaicML LLM Foundry authors
# SPDX-License-Identifier: Apache-2.0

"""The LLM Foundry Version."""

__version__ = '0.11.0.dev'
3 changes: 2 additions & 1 deletion llmfoundry/callbacks/async_eval_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ def launch_run(self, checkpoint: str, current_interval: Time) -> Run:
installation_path = i['path']

if not found_llm_foundry:
from llmfoundry import __version__ as latest_foundry_version
from llmfoundry._version import \
__version__ as latest_foundry_version

# If github integration is not found, foundry is likely installed
# through the run command. In this case, we'll add the integration
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ reportMissingImports = "none"
# Pytest
[tool.pytest.ini_options]
# By default, skip gpu tests
addopts = "--tb=short -m 'not gpu'"
addopts = "--tb=short -m 'not gpu' --color=yes"

markers = [
# For distributed testing
Expand Down
22 changes: 10 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import copy
import os
import re
from typing import Any, Dict, Mapping

import setuptools
from setuptools import setup
Expand All @@ -15,17 +15,15 @@
_REPO_REAL_PATH = os.path.dirname(os.path.realpath(__file__))
_PACKAGE_REAL_PATH = os.path.join(_REPO_REAL_PATH, _PACKAGE_DIR)

# Read the repo version
# Read the llm-foundry version
# We can't use `.__version__` from the library since it's not installed yet
with open(os.path.join(_PACKAGE_REAL_PATH, '__init__.py')) as f:
version_path = os.path.join(_PACKAGE_REAL_PATH, '_version.py')
with open(version_path, encoding='utf-8') as f:
version_globals: Dict[str, Any] = {}
version_locals: Mapping[str, object] = {}
content = f.read()
# regex: '__version__', whitespace?, '=', whitespace, quote, version, quote
# we put parens around the version so that it becomes elem 1 of the match
expr = re.compile(
r"""^__version__\s*=\s*['"]([0-9]+\.[0-9]+\.[0-9]+(?:\.\w+)?)['"]""",
re.MULTILINE,
)
repo_version = expr.findall(content)[0]
exec(content, version_globals, version_locals)
repo_version = str(version_locals['__version__'])

# Use repo README for PyPi description
with open('README.md', 'r', encoding='utf-8') as fh:
Expand Down Expand Up @@ -56,7 +54,7 @@
install_requires = [
'mosaicml[libcloud,wandb,oci,gcs,mlflow]>=0.23.4,<0.24',
'mlflow>=2.14.1,<2.15',
'accelerate>=0.25,<0.33', # for HF inference `device_map`
'accelerate>=0.25,<0.34', # for HF inference `device_map`
'transformers>=4.43.2,<4.44',
'mosaicml-streaming>=0.8.0,<0.9',
'torch>=2.3.0,<2.4',
Expand All @@ -70,7 +68,7 @@
'onnx==1.16.1',
'onnxruntime==1.18.1',
'boto3>=1.21.45,<2',
'huggingface-hub>=0.19.0,<0.24',
'huggingface-hub>=0.19.0,<0.25',
'beautifulsoup4>=4.12.2,<5', # required for model download utils
'tenacity>=8.2.3,<9',
'catalogue>=2,<3',
Expand Down

0 comments on commit dbbe3c0

Please sign in to comment.