autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

autocomplete.load() console output

Open ramAdam opened this issue 10 years ago • 4 comments

training! Error in opening pickle object. Training on default corpus text. ('saving to:', '/usr/local/lib/python2.7/dist-packages/autocomplete/models_compressed.pkl') Traceback (most recent call last): File "/home/dev/Documents/atom-workspace/autocom.py", line 4, in autocomplete.load() File "/usr/local/lib/python2.7/dist-packages/autocomplete/init.py", line 69, in load models.load_models() File "/usr/local/lib/python2.7/dist-packages/autocomplete/models.py", line 108, in load_models train_bigtxt() File "/usr/local/lib/python2.7/dist-packages/autocomplete/models.py", line 71, in train_bigtxt train_models(str(bigtxtfile.read())) File "/usr/local/lib/python2.7/dist-packages/autocomplete/models.py", line 61, in train_models save_models(os.path.join(os.path.dirname(file), model_name)) File "/usr/local/lib/python2.7/dist-packages/autocomplete/models.py", line 85, in save_models open(path, 'wb'), IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/autocomplete/models_compressed.pkl' [Finished in 12.56s]

ramAdam avatar Jan 11 '16 04:01 ramAdam

execute the script with root permissions, the error will go away.

rhythm9229 avatar Jun 08 '16 12:06 rhythm9229

@rhythm9229 No! Don't do that. Instead, specify model_name in train_models. Give it an absolute path to where you want to save the database, for instance /home/guido/python/autocomplete/model.pkl:

models.train_models("big string of text", model_name="/home/guido/python/autocomplete/model.pkl")

bvanrijn avatar Sep 27 '16 13:09 bvanrijn

@bvanrijn What does "models" refer to in your code ?

How you change the text file Autocomplete relies on to autocomplete words. I'd like to change the autocompletion language by changing the text file used as basis to autocomplete.

ghost avatar Sep 26 '18 13:09 ghost

Hello from the future @PLChevalier! I think it is

from autocomplete import models

bvanrijn avatar Sep 26 '18 13:09 bvanrijn