project-alice-assistant / ProjectAliceSkills

A repository containing all curated skills made by the community
GNU General Public License v3.0
25 stars 15 forks source link

[BUG] nlu cache not purged if skill was deleted #116

Closed Fe3lApAcUt closed 4 years ago

Fe3lApAcUt commented 4 years ago

Describe the bug nlu cache under /home/pi/ProjectAlice/var/cache/nlu/trainingData is not cleaned-up if un-installing a skill

To Reproduce

  1. delete a skill
  2. check nlu cache folder
  3. JSON files from deleted skill is still there.

Expected behavior If deleting a skill, Alice should delete the JSON files in nlu cache folder, too

Logs

2020-04-04 09:04:54,069 [NLUTraining] - [ERROR] - [SnipsNlu] Error while training Snips NLU: Traceback (most recent call last):
  File "./venv/bin/snips-nlu", line 8, in <module>
    sys.exit(main())
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/snips_nlu/cli/init.py", line 52, in main
    args.func(args)
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/snips_nlu/cli/training.py", line 26, in _train
    args_namespace.random_seed)
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/snips_nlu/cli/training.py", line 56, in train
    engine = SnipsNLUEngine(config, random_state=random_state).fit(dataset)
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/snips_nlu/common/log_utils.py", line 30, in wrapped
    res = fn(*args, **kwargs)
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/snips_nlu/nlu_engine/nlu_engine.py", line 95, in fit
    dataset = validate_and_format_dataset(dataset)
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/snips_nlu/dataset/validation.py", line 76, in validate_and_format_dataset
    builtin_entity_parser)
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/snips_nlu/dataset/validation.py", line 140, in _validate_and_format_custom_entity
    validate_keys(entity, mandatory_keys, object_label="custom entity")
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/snips_nlu/common/dataset_utils.py", line 32, in validate_keys
    validate_key(obj, key, object_label)
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/snips_nlu/common/dataset_utils.py", line 27, in validate_key
    missing_key_error(key, object_label)
  File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/snips_nlu/common/dataset_utils.py", line 22, in missing_key_error
    % (object_label, key))
snips_nlu.exceptions.DatasetFormatError: Expected custom entity to have key: 'use_synonyms'
NoneType: None

Alice version 1.0.0-b1

Additional context Workaround: delete JSON files in nlu cache folder manually

Psychokiller1888 commented 4 years ago

How did you remove the skill?

Fe3lApAcUt commented 4 years ago

as discussed via Discord: removed manually and via web interface.

Tested the new commit: deleted a skill via web interface, but still the cached json files are in the folder.

Psychokiller1888 commented 4 years ago

Closing as no info since last fixes