paper-qa
paper-qa copied to clipboard
Can't recognize my file and error communicating with OpenAI
- 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:
It seems that it can't recognize my file and I have no idea.
- What I have done all: I used
pip install paper-qaand set OPENAI_API_KEY environment variable to my openai api key.
I'm a beginner. Can somebody tell me why? Thanks!
Similar issue. I can't even run from paperqa import Docs. Getting an error that API key is not set.
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.
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