pdfGPT icon indicating copy to clipboard operation
pdfGPT copied to clipboard

error cant create file already exists

Open xaccell opened this issue 2 years ago • 10 comments

Everytime I try to load a local PDF, it answers the first question, but after that it errors out with "cant create file that already exists".

xaccell avatar Apr 13 '23 15:04 xaccell

could you please try now. I had added a temporary embeddings file which was causing this error. Now I am able to run it correctly: image

bhaskatripathi avatar Apr 16 '23 15:04 bhaskatripathi

Did you fix the source code also so I could try it locally?

xaccell avatar Apr 19 '23 17:04 xaccell

yes, please get the latest code

bhaskatripathi avatar Apr 26 '23 09:04 bhaskatripathi

I just pulled the latest code and am also experiencing this issue. "FileExistsError: [WinError 183] Cannot create a file when that file already exists: "

zerickk avatar Apr 26 '23 17:04 zerickk

Please use this file https://huggingface.co/spaces/bhaskartripathi/pdfChatter/blob/main/app.py

bhaskatripathi avatar Apr 26 '23 18:04 bhaskatripathi

Please use this file https://huggingface.co/spaces/bhaskartripathi/pdfChatter/blob/main/app.py

Thank you. I just tried and still have the same error.

zerickk avatar Apr 26 '23 18:04 zerickk

The error you are getting is because the earlier code was checking if the embedding is created and save temporarily, it is not reloaded. This can save the computational effort of creating embedding on every call. However, as that code had some issue, I had removed that from the latest version. It looks like you are still using the previous code. Could you plz do a viewdiff ?

bhaskatripathi avatar Apr 26 '23 18:04 bhaskatripathi

I just copied the text from the link you sent and ran it. It has the changes indicated by hugginface on lines 52 and 188. Line 52: chunk = f'[Page no. {idx+start_page}]' + ' ' + '"' + chunk + '"' Is this the correct version?

zerickk avatar Apr 26 '23 18:04 zerickk

Yes that is correct

bhaskatripathi avatar Apr 27 '23 02:04 bhaskatripathi

the error still happens after a while

xaccell avatar Apr 27 '23 15:04 xaccell

I have tried it again and again but Not able to replicate it anymore.

bhaskatripathi avatar Apr 29 '23 12:04 bhaskatripathi