PARTHA181098 commited on
Commit
ef98b26
·
verified ·
1 Parent(s): 87fc592

Update agents/document_agent.py

Browse files
Files changed (1) hide show
  1. agents/document_agent.py +2 -1
agents/document_agent.py CHANGED
@@ -346,6 +346,7 @@ class DocumentAgent(BaseAgent):
346
 
347
  async def _extract_invoice_with_donut(self, file_name: str):
348
  images = self._pdf_to_images(file_name)
 
349
 
350
  # Assuming first page invoice
351
  image = images[0]
@@ -373,7 +374,7 @@ class DocumentAgent(BaseAgent):
373
  sequence = self.processor.batch_decode(outputs.sequences)[0]
374
  sequence = sequence.replace(self.processor.tokenizer.eos_token, "").strip()
375
  sequence = sequence.replace(task_prompt, "").strip()
376
-
377
  return safe_json_parse(sequence)
378
 
379
  async def _enhance_invoice_data(self, invoice_data: InvoiceData, raw_text: str) -> InvoiceData:
 
346
 
347
  async def _extract_invoice_with_donut(self, file_name: str):
348
  images = self._pdf_to_images(file_name)
349
+ print('images from donut', images)
350
 
351
  # Assuming first page invoice
352
  image = images[0]
 
374
  sequence = self.processor.batch_decode(outputs.sequences)[0]
375
  sequence = sequence.replace(self.processor.tokenizer.eos_token, "").strip()
376
  sequence = sequence.replace(task_prompt, "").strip()
377
+ print('seq from donut:', sequence)
378
  return safe_json_parse(sequence)
379
 
380
  async def _enhance_invoice_data(self, invoice_data: InvoiceData, raw_text: str) -> InvoiceData: