Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
089a63e0
Commit
089a63e0
authored
Mar 05, 2024
by
Jannik Streidl
Browse files
feat: added ocr functionality to the pdf loader
parent
eb51ad14
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
backend/apps/rag/main.py
backend/apps/rag/main.py
+1
-1
backend/requirements.txt
backend/requirements.txt
+1
-0
No files found.
backend/apps/rag/main.py
View file @
089a63e0
...
@@ -419,7 +419,7 @@ def get_loader(filename: str, file_content_type: str, file_path: str):
...
@@ -419,7 +419,7 @@ def get_loader(filename: str, file_content_type: str, file_path: str):
]
]
if
file_ext
==
"pdf"
:
if
file_ext
==
"pdf"
:
loader
=
PyPDFLoader
(
file_path
)
loader
=
PyPDFLoader
(
file_path
,
extract_images
=
True
)
elif
file_ext
==
"csv"
:
elif
file_ext
==
"csv"
:
loader
=
CSVLoader
(
file_path
)
loader
=
CSVLoader
(
file_path
)
elif
file_ext
==
"rst"
:
elif
file_ext
==
"rst"
:
...
...
backend/requirements.txt
View file @
089a63e0
...
@@ -33,6 +33,7 @@ pandas
...
@@ -33,6 +33,7 @@ pandas
openpyxl
openpyxl
pyxlsb
pyxlsb
xlrd
xlrd
rapidocr-onnxruntime
faster-whisper
faster-whisper
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment