Skip to content

Commit

Permalink
__adapters_version__ -> adapters.__version__
Browse files Browse the repository at this point in the history
  • Loading branch information
calpt committed Mar 15, 2022
1 parent 1e4149c commit 7b9ca27
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def run(self):

setup(
name="adapter-transformers",
version="2.3.0a0",
version="3.0.0a0",
author="Jonas Pfeiffer, Andreas Rücklé, Clifton Poth, Hannah Sterz, based on work by Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Sam Shleifer, Patrick von Platen, Sylvain Gugger, Suraj Patil, Stas Bekman, Google AI Language Team Authors, Open AI team Authors, Facebook AI Authors, Carnegie Mellon University Authors",
author_email="[email protected]",
description="A friendly fork of Huggingface's Transformers, adding Adapters to PyTorch language models",
Expand Down
3 changes: 1 addition & 2 deletions src/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
# to defer the actual importing for when the objects are requested. This way `import transformers` provides the names
# in the namespace without actually importing anything (and especially none of the backends).

__adapters_version__ = "2.3.0a0"
__version__ = "4.12.5"

# Work around to update TensorFlow's absl.logging threshold which alters the
Expand Down Expand Up @@ -3706,7 +3705,7 @@
globals()["__file__"],
_import_structure,
module_spec=__spec__,
extra_objects={"__version__": __version__, "__adapters_version__": __adapters_version__},
extra_objects={"__version__": __version__},
)


Expand Down
9 changes: 8 additions & 1 deletion src/transformers/adapters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "3.0.0a0"

from typing import TYPE_CHECKING

from ..file_utils import _LazyModule
Expand Down Expand Up @@ -203,4 +205,9 @@
else:
import sys

sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure)
sys.modules[__name__] = _LazyModule(
__name__,
globals()["__file__"],
_import_structure,
extra_objects={"__version__": __version__},
)
4 changes: 2 additions & 2 deletions src/transformers/adapters/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
from filelock import FileLock
from huggingface_hub import HfApi, snapshot_download

from .. import __adapters_version__
from ..file_utils import get_from_cache, is_remote_url, torch_cache_home
from . import __version__


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -399,7 +399,7 @@ def pull_from_hf_model_hub(specifier: str, version: str = None, **kwargs) -> str
revision=version,
cache_dir=kwargs.pop("cache_dir", None),
library_name="adapter-transformers",
library_version=__adapters_version__,
library_version=__version__,
)
return download_path

Expand Down
4 changes: 2 additions & 2 deletions src/transformers/commands/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import platform
from argparse import ArgumentParser

from .. import __adapters_version__
from ..adapters import __version__
from ..file_utils import is_flax_available, is_tf_available, is_torch_available
from . import BaseTransformersCLICommand

Expand Down Expand Up @@ -67,7 +67,7 @@ def run(self):
jax_backend = jax.lib.xla_bridge.get_backend().platform

info = {
"`adapter-transformers` version": __adapters_version__,
"`adapter-transformers` version": __version__,
"Platform": platform.platform(),
"Python version": platform.python_version(),
"PyTorch version (GPU?)": f"{pt_version} ({pt_cuda_available})",
Expand Down

0 comments on commit 7b9ca27

Please sign in to comment.