run-llama / llama_parse

Parse files for optimal RAG
https://www.llamaindex.ai
MIT License
1.79k stars 157 forks source link

SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1129) #95

Open matthew-heartful opened 3 months ago

matthew-heartful commented 3 months ago

The script was working just an hour ago

Full error: Error while parsing the PDF file './papers/A_Survey_on_Contextual_Embeddings.pdf': [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1129)

Script:

import nest_asyncio from llama_parse import LlamaParse

async def convert_pdf_to_markdown(file_name): loop = asyncio.get_running_loop() pdf_file_path = os.path.join("./papers/", file_name)

def parse_pdf():
    parser = LlamaParse(
        api_key=llamaindex_api_key,
        result_type="markdown", 
        verbose=True,  
    )
    documents = parser.load_data(pdf_file_path)
    return documents[0].get_content()

# Run the synchronous function in a thread pool
documents = await loop.run_in_executor(None, parse_pdf)
return documents

Example usage

async def main(): file_name = "A_Survey_on_Contextual_Embeddings.pdf" documents = await convert_pdf_to_markdown(file_name) print(documents)

Run the async main function

if name == 'main': asyncio.run(main())

matthew-heartful commented 3 months ago

File Contextual Embeddings Survey.pdf

jaideep11061982 commented 2 weeks ago

@matthew-heartful @seldo @hexapode @erichare @yisding any soln for the issue ?