Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -44,9 +44,9 @@ def chatbot_response(pdf, question):
|
|
44 |
# Speichern der hochgeladenen PDF-Datei im Arbeitsspeicher
|
45 |
pdf_path = "uploaded_pdf.pdf"
|
46 |
|
47 |
-
#
|
48 |
with open(pdf_path, "wb") as f:
|
49 |
-
f.write(pdf
|
50 |
|
51 |
# OCR-Textextraktion
|
52 |
extracted_text = ocr_tool.extract_text(pdf_path)
|
|
|
44 |
# Speichern der hochgeladenen PDF-Datei im Arbeitsspeicher
|
45 |
pdf_path = "uploaded_pdf.pdf"
|
46 |
|
47 |
+
# 'pdf' enthält den Byte-Stream, du musst ihn als Datei speichern
|
48 |
with open(pdf_path, "wb") as f:
|
49 |
+
f.write(pdf) # Direktes Schreiben des Byte-Streams in eine PDF-Datei
|
50 |
|
51 |
# OCR-Textextraktion
|
52 |
extracted_text = ocr_tool.extract_text(pdf_path)
|