Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dicklesworthstone committed May 21, 2024
1 parent 6f2964d commit 34d135a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ async def parse_submitted_document_file_into_sentence_strings_func(temp_file_pat
content = buffer.read()
else:
try:
content = textract.process(temp_file_path, method='pdfminer', encoding='utf-8')
content = textract.process(temp_file_path, method='pdfminer')
content = content.decode('utf-8')
except Exception as e:
logger.error(f"Error while processing file: {e}, mime_type: {mime_type}")
Expand All @@ -512,7 +512,7 @@ async def parse_submitted_document_file_into_sentence_strings_func(temp_file_pat
if len(sentences) == 0 and temp_file_path.lower().endswith('.pdf'):
logger.info("No sentences found, attempting OCR using Tesseract.")
try:
content = textract.process(temp_file_path, method='tesseract', encoding='utf-8')
content = textract.process(temp_file_path, method='tesseract')
content = content.decode('utf-8')
sentences = sophisticated_sentence_splitter(content)
except Exception as e:
Expand Down

0 comments on commit 34d135a

Please sign in to comment.