Skip to content

Commit 1601a07

Browse files
committed
Merge branch 'master' into v2
Merges inter_threads and intra_threads change
2 parents 61e4733 + 0423c4a commit 1601a07

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

argostranslate/package.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ def uninstall(pkg):
395395
info("Uninstalled package", pkg)
396396
shutil.rmtree(pkg.package_path)
397397

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

418419
install_from_path(package_to_install.download())
419420
return True
420-

argostranslate/settings.py

+4
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ def get_setting(key: str, default=None):
104104
# Supported values: "cpu" and "cuda"
105105
device = get_setting("ARGOS_DEVICE_TYPE", "cpu")
106106

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

108112
class ModelProvider(Enum):
109113
OPENNMT = 0

0 commit comments

Comments
 (0)