rohitashva commited on
Commit
83ebead
·
verified ·
1 Parent(s): 8595f99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -4,12 +4,14 @@ from pdf2image import convert_from_bytes
4
  import google.generativeai as genai
5
  import os
6
 
7
- pytesseract.pytesseract.tesseract_cmd = "/usr/bin/tesseract"
8
 
9
- # Set Poppler path explicitly
10
- POPPLER_PATH = "/usr/bin"
 
11
 
12
  def extract_text_from_pdf(uploaded_file):
 
13
  images = convert_from_bytes(uploaded_file.read(), poppler_path=POPPLER_PATH)
14
 
15
  extracted_text = ""
 
4
  import google.generativeai as genai
5
  import os
6
 
7
+ from pdf2image import convert_from_bytes
8
 
9
+ # Set the correct paths
10
+ pytesseract.pytesseract.tesseract_cmd = "/usr/bin/tesseract"
11
+ POPPLER_PATH = "/usr/bin" # Explicitly define Poppler path
12
 
13
  def extract_text_from_pdf(uploaded_file):
14
+ # Convert PDF to images using the correct Poppler path
15
  images = convert_from_bytes(uploaded_file.read(), poppler_path=POPPLER_PATH)
16
 
17
  extracted_text = ""