Open ramAdam opened 8 years ago
execute the script with root permissions, the error will go away.
@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 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.
Hello from the future @PLChevalier! I think it is
from autocomplete import models
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]