hwchase17 / notion-qa

MIT License
2.13k stars 374 forks source link

NotImplementedError: cannot instantiate 'PosixPath' on your system #12

Open yogeshhk opened 1 year ago

yogeshhk commented 1 year ago

Traceback (most recent call last): File "notion-qa-hwchase17\main.py", line 13, in store = pickle.load(f) File "..\AppData\Local\Continuum\anaconda3\envs\langchain\lib\pathlib.py", line 1084, in new raise NotImplementedError("cannot instantiate %r on your system" NotImplementedError: cannot instantiate 'PosixPath' on your system

G1213123 commented 1 year ago

I added this solution to the main.py and it fixes the problem: https://stackoverflow.com/questions/57286486/i-cant-load-my-model-because-i-cant-put-a-posixpath

import pathlib
temp = pathlib.PosixPath
pathlib.PosixPath = pathlib.WindowsPath
DanielThaumazo commented 1 year ago

Worked for me when added to top of qa.py rather than main.py

DanielThaumazo commented 1 year ago

The origin of the issue, I think is within faiss_store.pkl, as a reference to a PosixPath is embedded.