Skip to content

Commit

Permalink
👽 Remove allenai-common
Browse files Browse the repository at this point in the history
👽 Remove allenai-common
  • Loading branch information
alekseymalakhov11 authored Sep 15, 2024
2 parents fe1e686 + 73560d2 commit 99d32f4
Show file tree
Hide file tree
Showing 21 changed files with 2,428 additions and 1,099 deletions.
2,434 changes: 1,355 additions & 1,079 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ hvac ="^1.1.1"
python-dotenv ="^1.0.0"
sentence-transformers ="^2.2.2"
protobuf ="^3.20.0"
allenai-common = "^1.1.2"
rouge-score ="^0.1.2"
ftfy ="^6.1.1"
iopath ="^0.1.10"
Expand All @@ -44,13 +43,14 @@ pydantic ="^2.7.0"
timm ="^0.9.7"
opencv-python = "^4.10.0.84"
langchain-huggingface = "^0.0.3"
clearml = "^1.16.4"
cached-path = "^1.6.3"

faiss-gpu = { version = "^1.7.2", optional = true }
xformers = { version = "^0.0.23.post1", optional = true }
vllm = { version = "^0.4.0.post1", optional = true }
deepspeed = { version = "0.12", optional = true }
accelerate = { version = "0.27", optional = true }
clearml = "^1.16.4"


[tool.poetry.dev-dependencies]
Expand All @@ -72,4 +72,4 @@ gpu = ["faiss-gpu", "xformers", "vllm"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
build-backend = "poetry.core.masonry.api"
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ disable=
W0622,
# Too many ancestors
R0901,

# logging-fstring-interpolation
W1203,
ignore=
data
ignore-patterns=
3 changes: 1 addition & 2 deletions turbo_alignment/common/data/multimodal/registry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from allenai_common import Registrable

from turbo_alignment.common.registry import Registrable
from turbo_alignment.settings.modality import Modality


Expand Down
4 changes: 4 additions & 0 deletions turbo_alignment/common/registry/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from turbo_alignment.common.registry.from_params import FromParams
from turbo_alignment.common.registry.lazy import Lazy
from turbo_alignment.common.registry.params import Params
from turbo_alignment.common.registry.registrable import Registrable
17 changes: 17 additions & 0 deletions turbo_alignment/common/registry/checks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# mypy: ignore-errors
import logging
from typing import Any

logger = logging.getLogger(__name__)


class ConfigurationError(Exception):
def __reduce__(self) -> str | tuple[Any, ...]:
return type(self), (self.message,)

def __init__(self, message: str):
super().__init__()
self.message = message

def __str__(self):
return self.message
24 changes: 24 additions & 0 deletions turbo_alignment/common/registry/file_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# mypy: ignore-errors
import logging
import os
from pathlib import Path

import cached_path as _cached_path

logger = logging.getLogger(__name__)


def cached_path(
url_or_filename: str | os.PathLike,
cache_dir: str | Path = None,
extract_archive: bool = False,
force_extract: bool = False,
) -> str:
return str(
_cached_path.cached_path(
url_or_filename,
cache_dir=cache_dir,
extract_archive=extract_archive,
force_extract=force_extract,
)
)
Loading

0 comments on commit 99d32f4

Please sign in to comment.