paper-qa icon indicating copy to clipboard operation
paper-qa copied to clipboard

Can't recognize my file and error communicating with OpenAI

Open flypde opened this issue 2 years ago • 2 comments

  • My operator sysytem: Windows 11 -My code:
from paperqa import Docs

path1 = "D:\\testqa.pdf"
citation1 = "Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep learning. MIT press."

path2 = "D:\\test.pdf"
citation2 = "Mitchell, T. M. (1997). Machine learning. McGraw Hill."

doc_paths = [path1, path2]
doc_citations = [citation1, citation2]

docs = Docs()
for path, citation in zip(doc_paths, doc_citations):
    docs.add(path, citation)

answer = docs.query("what is the main topic of this article?", k=1, max_sources=1)
print(answer.formatted_answer)

Then it occurs that: image It seems that it can't recognize my file and I have no idea. image

  • What I have done all: I used pip install paper-qa and set OPENAI_API_KEY environment variable to my openai api key.

I'm a beginner. Can somebody tell me why? Thanks!

flypde avatar Jun 15 '23 11:06 flypde

Similar issue. I can't even run from paperqa import Docs. Getting an error that API key is not set.

vjagodnik avatar Jun 27 '23 20:06 vjagodnik

I am also getting this error, with multiple API keys, just running the basic example from the paper-qa github.

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1002)

This seems to be the meat of the problem. However I don't know how to resolve it. I've done all the standard moves of reinstalling certificates, installing certifi, and so on.

Brigadirk avatar Dec 04 '23 15:12 Brigadirk

For stuff like path1 = "D:\\testqa.pdf", it's best to use pathlib.Path to manage drives and everything.

Also, we have just released version 5, which completely outsources all LLM management to https://github.com/BerriAI/litellm. So the OpenAI communication error is now outside of this repo.

If your issue persists, please reopen a new issue using paper-qa>=5

jamesbraza avatar Sep 11 '24 18:09 jamesbraza