You can try something like this:
from rasa.train import train_nlu
for module_name in modules:
module_directory = os.path.join(MODULES_BASE_DIR, module_name)
config_file = <path to config file>
nlu_data = <path to NLU training folder or file>
train_nlu(
config=config_file,
nlu_data=nlu_data,
output=module_directory,
fixed_model_name=module_name,
)
In Rasa 1.x the model files are zipped. So train_nlu
will create a zipped model file in the provided output directory (module_directory
) with a fixed name (<module_name>.tar.gz
).
Regarding your second point: The core and nlu server were merged in Rasa 1.x. It is not possible to have multiple models loaded at the same time anymore. For more information please see Removing projects for Rasa NLU server. Feel free to leave your feedback in that thread.