Spaces:
Sleeping
Sleeping
Update app.py
Browse files10 unmodified lines1112131415161718192021222324252610 unmodified linesimport nltknltk.download('punkt')# Install Poppler in the runtime environmentos.system("apt-get update && apt-get install -y poppler-utils")secret = os.getenv('Groq_api')working_dir = os.path.dirname(os.path.abspath(__file__))def load_documents(file_path):# Specify poppler_path to ensure compatibility in Spacesloader = UnstructuredPDFLoader(file_path, poppler_path="/usr/bin")documents = loader.load()return documents10 unmodified lines111213141516171819202122232425262728293010 unmodified linesimport nltknltk.download('punkt')# Install Poppler and Tesseract in the runtime environmentos.system("apt-get update && apt-get install -y poppler-utils tesseract-ocr")secret = os.getenv('Groq_api')working_dir = os.path.dirname(os.path.abspath(__file__))def load_documents(file_path):# Specify poppler_path and tesseract_path to ensure compatibilityloader = UnstructuredPDFLoader(file_path,poppler_path="/usr/bin",tesseract_path="/usr/bin/tesseract")documents = loader.load()return documents
app.py+8-4