Skip to content

Commit

Permalink
nit -- lets using asyncio_run
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-markewich committed Nov 1, 2024
1 parent 481411b commit e892771
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions llama_parse/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from fsspec import AbstractFileSystem
from fsspec.spec import AbstractBufferedFile
from llama_index.core.async_utils import run_jobs
from llama_index.core.async_utils import asyncio_run, run_jobs
from llama_index.core.bridge.pydantic import Field, field_validator
from llama_index.core.constants import DEFAULT_BASE_URL
from llama_index.core.readers.base import BasePydanticReader
Expand Down Expand Up @@ -473,7 +473,7 @@ def load_data(
) -> List[Document]:
"""Load data from the input path."""
try:
return asyncio.run(self.aload_data(file_path, extra_info, fs=fs))
return asyncio_run(self.aload_data(file_path, extra_info, fs=fs))
except RuntimeError as e:
if nest_asyncio_err in str(e):
raise RuntimeError(nest_asyncio_msg)
Expand Down Expand Up @@ -540,7 +540,7 @@ def get_json_result(
) -> List[dict]:
"""Parse the input path."""
try:
return asyncio.run(self.aget_json(file_path, extra_info))
return asyncio_run(self.aget_json(file_path, extra_info))
except RuntimeError as e:
if nest_asyncio_err in str(e):
raise RuntimeError(nest_asyncio_msg)
Expand Down Expand Up @@ -603,7 +603,7 @@ async def aget_images(
def get_images(self, json_result: List[dict], download_path: str) -> List[dict]:
"""Download images from the parsed result."""
try:
return asyncio.run(self.aget_images(json_result, download_path))
return asyncio_run(self.aget_images(json_result, download_path))
except RuntimeError as e:
if nest_asyncio_err in str(e):
raise RuntimeError(nest_asyncio_msg)
Expand Down Expand Up @@ -657,7 +657,7 @@ async def aget_xlsx(
def get_xlsx(self, json_result: List[dict], download_path: str) -> List[dict]:
"""Download xlsx from the parsed result."""
try:
return asyncio.run(self.aget_xlsx(json_result, download_path))
return asyncio_run(self.aget_xlsx(json_result, download_path))
except RuntimeError as e:
if nest_asyncio_err in str(e):
raise RuntimeError(nest_asyncio_msg)
Expand Down

0 comments on commit e892771

Please sign in to comment.