MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / get_data_dir

Function get_data_dir

python/tests/test_utils.py:11–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10
11def get_data_dir():
12 data_dir = os.path.join(
13 os.path.dirname(os.path.realpath(__file__)), "..", "..", "tests", "data"
14 )
15
16 # Verify that downloaded files are present.
17 translit_model = os.path.join(data_dir, "models", "transliteration-aren-all")
18 if not os.path.isdir(translit_model):
19 pytest.skip("Data files are not available")
20
21 return data_dir
22
23
24def write_tokens(batch_tokens, path):

Callers 1

TEST_PFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected