Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -17,10 +17,10 @@ async def home():
|
|
| 17 |
@app.post('/PromptBuddy')
|
| 18 |
async def PromptLLM(file: UploadFile = File(...), query: str = Form(...)):
|
| 19 |
|
| 20 |
-
with open(file.filename,
|
| 21 |
-
|
| 22 |
|
| 23 |
-
loader = PyMuPDFLoader(file_path=
|
| 24 |
data = loader.load()
|
| 25 |
|
| 26 |
# Create embeddings using Sentence Transformers
|
|
|
|
| 17 |
@app.post('/PromptBuddy')
|
| 18 |
async def PromptLLM(file: UploadFile = File(...), query: str = Form(...)):
|
| 19 |
|
| 20 |
+
with open(f"uploads/{file.filename}", "wb") as f:
|
| 21 |
+
f.write(file.file.read())
|
| 22 |
|
| 23 |
+
loader = PyMuPDFLoader(file_path=f"uploads/{file.filename}")
|
| 24 |
data = loader.load()
|
| 25 |
|
| 26 |
# Create embeddings using Sentence Transformers
|