diff --git a/daras_ai_v2/azure_doc_extract.py b/daras_ai_v2/azure_doc_extract.py index 5b63cc18b..173bb080d 100644 --- a/daras_ai_v2/azure_doc_extract.py +++ b/daras_ai_v2/azure_doc_extract.py @@ -67,11 +67,9 @@ def azure_form_recognizer(url: str, model_id: str, params: dict = None): def extract_records(result: dict, page_num: int) -> list[dict]: - if not result: - return [] table_polys = extract_tables(result, page_num) records = [] - for para in result["paragraphs"]: + for para in result.get("paragraphs", []): try: if para["boundingRegions"][0]["pageNumber"] != page_num: continue