MULTIFIT - Runtime error: Permission denied

Facing the same error with ULMFiT also.There seems to be a small issue in the way sentencepiece is called - the quotemark around model prefix parameter needs to be removed. I was able to fix it by updating the sentencepiece call in site-packages/fastai/text/data.py to:

 SentencePieceTrainer.Train(" ".join([
        f"--input={quotemark}{raw_text_path}{quotemark} --max_sentence_length={max_sentence_len}",
        f"--character_coverage={ifnone(char_coverage, 0.99999 if lang in full_char_coverage_langs else 0.9998)}",
        f"--unk_id={len(defaults.text_spec_tok)} --pad_id=-1 --bos_id=-1 --eos_id=-1",
        f"--user_defined_symbols={','.join(spec_tokens)}",
        f"--model_prefix={cache_dir/'spm'} --vocab_size={vocab_sz} --model_type={model_type}"]))
1 Like