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
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
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)
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())