Skip to content

Commit cbc1436

Browse files
authored
#255 used download transformers model from te (#282)
* #255: Used download_transformers_model() from TE
1 parent 0ed9461 commit cbc1436

File tree

5 files changed

+171
-167
lines changed

5 files changed

+171
-167
lines changed

doc/changes/unreleased.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ Additionally the release includes a CLI for populating the Secure Configuration
2626
* #260: Added unit tests for CLI param wrappers
2727
* #265: Fixed type hints in tests
2828
* #251: Re-enabled SaaS integration tests
29+
* #255: Used `download_transformers_model()` from TE

exasol/nb_connector/cli/processing/bucketfs_access.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def random_string(length: int = 10) -> str:
1414
return "".join(random.choice(string.ascii_uppercase) for _ in range(length))
1515

1616

17-
def random_file_name(other_than: list[str]) -> bfs.path.PathLike:
17+
def random_file_name(other_than: list[str]) -> str:
1818
result = None
1919
while result is None or result in other_than:
2020
infix = random_string()

exasol/nb_connector/model_installation.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
from typing import Any
44

55
from exasol.ai.text.extractors.bucketfs_model_repository import BucketFSRepository
6-
from exasol.ai.text.impl.utils.transformers_utils import download_transformers_model
6+
from exasol_transformers_extension.utils.bucketfs_model_specification import (
7+
BucketFSModelSpecification,
8+
)
9+
from exasol_transformers_extension.utils.model_utils import install_huggingface_model
710
from yaspin import yaspin
811

912
from exasol.nb_connector.ai_lab_config import AILabConfig as CKey
@@ -52,11 +55,13 @@ def install_model(conf: Secrets, model: TransformerModel) -> None:
5255
with yaspin(text=f"- Huggingface model {model.name}") as spinner:
5356
if not _interactive_usage():
5457
spinner.hide()
55-
download_transformers_model(
58+
sub_dir = ensure_model_subdir_config_value(conf)
59+
model_spec = BucketFSModelSpecification(
60+
model.name, model.task_type, "", sub_dir
61+
)
62+
install_huggingface_model(
5663
bucketfs_location=bucketfs_location,
57-
sub_dir=ensure_model_subdir_config_value(conf),
58-
task_type=model.task_type,
59-
model_name=model.name,
64+
model_spec=model_spec,
6065
model_factory=model.factory,
6166
)
6267
spinner.ok(CHECKMARK)

0 commit comments

Comments
 (0)