Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Vector model file not found #2

Closed
chicham opened this issue Aug 13, 2020 · 3 comments
Closed

Vector model file not found #2

chicham opened this issue Aug 13, 2020 · 3 comments
Assignees
Milestone

Comments

@chicham
Copy link

chicham commented Aug 13, 2020

Hello,

Thank you very much for the project. But I have one small issue, right now it seems that when you run python -m codequestion.download it downloads a configuration file that will be used by codequestion to load the model.

The path to the model seems hardcoded to /home/dmezzett/.codequestion/vectors/stackexchange-300d.magnitude
How can we specify to codequestion to use our home or modify the config file?

Best

@davidmezzetti
Copy link
Member

Thank you for reporting this, I'm working on an updated version of codequestion backed by txtai. I will make sure to resolve this issue with that release.

In terms of a workaround, the config file is just a dict object that was pickled to a file. If you open a python shell in ~/.codequestion/models and edit/run the following code, if should workaround the issue:

import pickle

with open("config", "rb") as handle:
    config = pickle.load(handle)

config["path"] = "/<your home directory>/.codequestion/vectors/stackexchange-300d.magnitude"

with open("config", "wb") as handle:
    pickle.dump(config, handle, protocol=pickle.HIGHEST_PROTOCOL)

@chicham
Copy link
Author

chicham commented Aug 14, 2020

Thanks for your quick response !

@belvederef
Copy link

I just want to point out to newcomers that the script proposed by davidmezzetti should be run in the "stackexchange folder". Btw, thanks for this amazing package!

@davidmezzetti davidmezzetti self-assigned this Oct 3, 2022
@davidmezzetti davidmezzetti added this to the v1.1.0 milestone Oct 3, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants