NotImplementedError: cannot instantiate 'PosixPath' on your system
yogeshhk opened this issue · 3 comments
yogeshhk commented
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
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
Worked for me when added to top of qa.py rather than main.py
DanielThaumazo commented
The origin of the issue, I think is within faiss_store.pkl, as a reference to a PosixPath is embedded.