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 |
-
# 'pdf'
|
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' ist ein NamedString-Objekt. Wir müssen den Inhalt extrahieren und speichern
|
48 |
with open(pdf_path, "wb") as f:
|
49 |
+
f.write(pdf.name) # Hier verwenden wir 'pdf.name' und speichern den Inhalt direkt
|
50 |
|
51 |
# OCR-Textextraktion
|
52 |
extracted_text = ocr_tool.extract_text(pdf_path)
|