MCPcopy
hub / github.com/RasaHQ/rasa / _custom_default_config

Function _custom_default_config

tests/test_memory_leak.py:23–40  ·  view source on GitHub ↗
(
    tmp_path: Union[Path, Text], epochs: int, max_history: Optional[int] = -1
)

Source from the content-addressed store, hash-verified

21
22
23def _custom_default_config(
24 tmp_path: Union[Path, Text], epochs: int, max_history: Optional[int] = -1
25) -> Text:
26 # Override default config to use custom amount of epochs
27 default_config = Path("rasa", "shared", "importers", "default_config.yml")
28 config = rasa.shared.utils.io.read_yaml_file(default_config)
29
30 for model_part, items in config.items():
31 for item in items:
32 if "epochs" in item:
33 item["epochs"] = epochs
34 if "max_history" in item and max_history != -1:
35 item["max_history"] = None
36
37 config_for_test = Path(tmp_path) / "test_config.yml"
38 rasa.shared.utils.io.write_yaml(config, config_for_test)
39
40 return str(config_for_test)
41
42
43class MemoryLeakTest(abc.ABC):

Callers 2

function_to_profileMethod · 0.85
function_to_profileMethod · 0.85

Calls 1

itemsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…