Skip to content

Commit

Permalink
Merge branch 'master' into v2
Browse files Browse the repository at this point in the history
Merges inter_threads and intra_threads change
  • Loading branch information
PJ-Finlay committed Aug 15, 2024
2 parents 61e4733 + 0423c4a commit 1601a07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion argostranslate/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ def uninstall(pkg):
info("Uninstalled package", pkg)
shutil.rmtree(pkg.package_path)


def install_package_for_language_pair(from_code: str, to_code: str) -> bool:
"""Installs the necessary package to translate between a pair of languages
Args:
Expand All @@ -417,4 +418,3 @@ def install_package_for_language_pair(from_code: str, to_code: str) -> bool:

install_from_path(package_to_install.download())
return True

4 changes: 4 additions & 0 deletions argostranslate/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ def get_setting(key: str, default=None):
# Supported values: "cpu" and "cuda"
device = get_setting("ARGOS_DEVICE_TYPE", "cpu")

# https://opennmt.net/CTranslate2/python/ctranslate2.Translator.html
inter_threads = int(get_setting("ARGOS_INTER_THREADS", "1"))
intra_threads = int(get_setting("ARGOS_INTRA_THREADS", "0"))


class ModelProvider(Enum):
OPENNMT = 0
Expand Down

0 comments on commit 1601a07

Please sign in to comment.