Skip to content

Commit

Permalink
Merge pull request #17 from RasaHQ/str-path-fix
Browse files Browse the repository at this point in the history
cache-dir fix
  • Loading branch information
koaning authored Jul 22, 2020
2 parents 4963e6a + c766f9f commit 24620ad
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
2 changes: 2 additions & 0 deletions rasa_nlu_examples/errors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class RasaFileNotFound(Exception):
pass
2 changes: 1 addition & 1 deletion rasa_nlu_examples/featurizers/dense/bpemb_featurizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def required_packages(cls) -> List[Text]:
# model, the closest size is chosen
"vs_fallback": True,
# specifies the folder in which downloaded BPEmb files will be cached
"cache_dir": Path.home() / Path(".cache/bpemb"),
"cache_dir": str(Path.home() / Path(".cache/bpemb")),
# specifies the path to a custom SentencePiece model file
"model_file": None,
# specifies the path to a custom embedding file. Supported formats are Word2Vec
Expand Down
25 changes: 20 additions & 5 deletions tests/test_cli/test_commandline.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import subprocess

import pytest


@pytest.mark.parametrize(
"fp", ["fasttext-config.yml", "printer-config.yml", "bytepair-config.yml"]
)
def test_run_train_command(fp):
yml_files = ["fasttext-config.yml", "printer-config.yml", "bytepair-config.yml"]


@pytest.mark.parametrize("fp", yml_files)
def test_run_test_command(fp):
cmd = [
"rasa",
"test",
Expand All @@ -23,3 +23,18 @@ def test_run_train_command(fp):
]
status = subprocess.run(cmd)
assert status.returncode == 0


@pytest.mark.parametrize("fp", yml_files)
def test_run_train_command(fp):
cmd = [
"rasa",
"train",
"nlu",
"-u",
"tests/data/nlu.md",
"--config",
f"tests/configs/{fp}",
]
status = subprocess.run(cmd)
assert status.returncode == 0

0 comments on commit 24620ad

Please sign in to comment.