Zeggai Abdellah commited on
Commit
d76ad36
·
1 Parent(s): f1dfb78

update handling tables

Browse files
Files changed (1) hide show
  1. rag_pipeline.py +2 -2
rag_pipeline.py CHANGED
@@ -301,8 +301,8 @@ def process_question_with_sequential_citations(agent, question: str, chunks_dire
301
  for source_id in unique_ids: # This preserves the order
302
  for element in all_chunks_data:
303
  if element.get("type") == 'TableElement':
304
- if element.get("element_id") == source_id:
305
- cited_elements_ordered.append(element)
306
  break
307
  else:
308
  if "elements" in element:
 
301
  for source_id in unique_ids: # This preserves the order
302
  for element in all_chunks_data:
303
  if element.get("type") == 'TableElement':
304
+ if element.get("elements",{}).get("element_id") == source_id:
305
+ cited_elements_ordered.append(element.get("elements",{}))
306
  break
307
  else:
308
  if "elements" in element: