We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ad23d7 commit 8cd5af8Copy full SHA for 8cd5af8
1 file changed
src/unstructured_client/_hooks/custom/split_pdf_hook.py
@@ -350,8 +350,12 @@ def before_request(
350
351
pdf = self._trim_large_pages(pdf, form_data)
352
353
- pdf_file.seek(0)
354
- pdf_bytes = pdf_file.read()
+ if isinstance(pdf_file, bytes):
+ pdf_bytes = pdf_file
355
+ else:
356
+ pdf_file.seek(0)
357
+ pdf_bytes = pdf_file.read()
358
+
359
if self.cache_tmp_data_feature:
360
pdf_chunk_paths = self._get_pdf_chunk_paths(
361
pdf_bytes,
0 commit comments