Skip to content

Commit

Permalink
update setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfeil committed May 19, 2023
1 parent 66b1ead commit 23e683e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions hf_hub_ctranslate2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"""Compatability between Huggingface and Ctranslate2."""
# __all__ = ["__version__", "TranslatorCT2fromHfHub", "GeneratorCT2fromHfHub", "MultiLingualTranslatorCT2fromHfHub", "_private"]
from hf_hub_ctranslate2.translate import TranslatorCT2fromHfHub, GeneratorCT2fromHfHub, MultiLingualTranslatorCT2fromHfHub
from hf_hub_ctranslate2.util import _download_model
__version__ = "2.0.6"
6 changes: 3 additions & 3 deletions hf_hub_ctranslate2/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from typing import Any, Union, List
import os

from hf_hub_ctranslate2.util import _download_model
from hf_hub_ctranslate2.util import utils as _utils


class CTranslate2ModelfromHuggingfaceHub:
Expand All @@ -34,10 +34,10 @@ def __init__(
model_path = model_name_or_path
else:
try:
model_path = _download_model(model_name_or_path, hub_kwargs=hub_kwargs)
model_path = _utils._download_model(model_name_or_path, hub_kwargs=hub_kwargs)
except:
hub_kwargs["local_files_only"] = True
model_path = _download_model(model_name_or_path, hub_kwargs=hub_kwargs)
model_path = _utils._download_model(model_name_or_path, hub_kwargs=hub_kwargs)
self.model = self.ctranslate_class(
model_path,
device=device,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

setup(
name="hf_hub_ctranslate2",
packages=find_packages(where="hf_hub_ctranslate2"),
packages=find_packages(),
version=version,
description=("Connecting Transfromers on HuggingfaceHub with Ctranslate2 "),
long_description=long_description,
Expand Down

0 comments on commit 23e683e

Please sign in to comment.