Spaces:
Sleeping
Sleeping
Commit ·
e2afab9
1
Parent(s): 46c86b1
Update gradio_chatwithpdf.py
Browse files- gradio_chatwithpdf.py +1 -0
gradio_chatwithpdf.py
CHANGED
|
@@ -12,6 +12,7 @@ def read_PDF_2(fileobj):
|
|
| 12 |
|
| 13 |
temp_dir = tempfile.mkdtemp()
|
| 14 |
path = os.path.join(temp_dir, os.path.basename(fileobj.name))
|
|
|
|
| 15 |
|
| 16 |
with pdfplumber.open(path) as pdf:
|
| 17 |
for page in pdf.pages:
|
|
|
|
| 12 |
|
| 13 |
temp_dir = tempfile.mkdtemp()
|
| 14 |
path = os.path.join(temp_dir, os.path.basename(fileobj.name))
|
| 15 |
+
shutil.copyfile(fileobj.name, path)
|
| 16 |
|
| 17 |
with pdfplumber.open(path) as pdf:
|
| 18 |
for page in pdf.pages:
|