Spaces:
Sleeping
Sleeping
Commit
•
7461627
1
Parent(s):
a57bc7d
fix path issue in app/main.py
Browse files- app/main.py +1 -6
app/main.py
CHANGED
@@ -12,11 +12,6 @@ from config import settings
|
|
12 |
app = FastAPI()
|
13 |
|
14 |
|
15 |
-
UPLOAD_DIRECTORY = "./static"
|
16 |
-
if not os.path.exists(UPLOAD_DIRECTORY):
|
17 |
-
os.makedirs(UPLOAD_DIRECTORY)
|
18 |
-
|
19 |
-
|
20 |
# TODO: Remove this extra endpoint
|
21 |
@app.get("/")
|
22 |
async def root():
|
@@ -88,4 +83,4 @@ async def insert_all_pdfs_to_pinecone():
|
|
88 |
fname = filename.split('_')[-1]
|
89 |
path = f"{uid}_{fname}"
|
90 |
text_to_pdf(content, os.path.join(media_dir, path))
|
91 |
-
index.upsert([(uid, embedding.tolist(), {"title": title, "path": path, "filename": filename})])
|
|
|
12 |
app = FastAPI()
|
13 |
|
14 |
|
|
|
|
|
|
|
|
|
|
|
15 |
# TODO: Remove this extra endpoint
|
16 |
@app.get("/")
|
17 |
async def root():
|
|
|
83 |
fname = filename.split('_')[-1]
|
84 |
path = f"{uid}_{fname}"
|
85 |
text_to_pdf(content, os.path.join(media_dir, path))
|
86 |
+
index.upsert([(uid, embedding.tolist(), {"title": title, "path": path, "filename": filename})])
|