Spaces:
Runtime error
Runtime error
Revert "test"
Browse filesThis reverts commit f9249d7038f27621611bf0ef7c2e09ff689af20a.
- app/main.py +0 -7
- requirements.txt +1 -2
app/main.py
CHANGED
@@ -9,7 +9,6 @@ from fastapi.middleware import Middleware
|
|
9 |
from fastapi.middleware.cors import CORSMiddleware
|
10 |
from fastapi.responses import StreamingResponse
|
11 |
from .rag import ChatPDF
|
12 |
-
import pdfplumber
|
13 |
|
14 |
middleware = [
|
15 |
Middleware(
|
@@ -65,12 +64,6 @@ def upload(data: bytes = Depends(parse_body)):
|
|
65 |
path = f"{files_dir}/file.pdf"
|
66 |
with open(path, "wb") as f:
|
67 |
f.write(data)
|
68 |
-
# with open(path, "wb") as f:
|
69 |
-
pdf = pdfplumber.open(path)
|
70 |
-
page = pdf.pages[0]
|
71 |
-
text = page.extract_text()
|
72 |
-
print(text)
|
73 |
-
pdf.close()
|
74 |
session_assistant.ingest(files_dir)
|
75 |
pathlib.Path(path).unlink()
|
76 |
except Exception as e:
|
|
|
9 |
from fastapi.middleware.cors import CORSMiddleware
|
10 |
from fastapi.responses import StreamingResponse
|
11 |
from .rag import ChatPDF
|
|
|
12 |
|
13 |
middleware = [
|
14 |
Middleware(
|
|
|
64 |
path = f"{files_dir}/file.pdf"
|
65 |
with open(path, "wb") as f:
|
66 |
f.write(data)
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
session_assistant.ingest(files_dir)
|
68 |
pathlib.Path(path).unlink()
|
69 |
except Exception as e:
|
requirements.txt
CHANGED
@@ -6,5 +6,4 @@ llama-index-llms-llama-cpp
|
|
6 |
llama-index-embeddings-fastembed
|
7 |
qdrant-client
|
8 |
unstructured
|
9 |
-
fastembed==0.2.7
|
10 |
-
pdfplumber
|
|
|
6 |
llama-index-embeddings-fastembed
|
7 |
qdrant-client
|
8 |
unstructured
|
9 |
+
fastembed==0.2.7
|
|