Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -15,9 +15,11 @@ async def home():
|
|
| 15 |
return "API Server Running"
|
| 16 |
|
| 17 |
@app.post('/PromptBuddy')
|
| 18 |
-
async def PromptLLM(file: UploadFile, query: str = Form(...)):
|
| 19 |
|
| 20 |
-
file.
|
|
|
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
loader = PyMuPDFLoader(file_path= file.filename)
|
|
|
|
| 15 |
return "API Server Running"
|
| 16 |
|
| 17 |
@app.post('/PromptBuddy')
|
| 18 |
+
async def PromptLLM(file: UploadFile = File(...), query: str = Form(...)):
|
| 19 |
|
| 20 |
+
contents = await file.read()
|
| 21 |
+
with open(file.filename, 'wb') as f:
|
| 22 |
+
f.write(contents)
|
| 23 |
|
| 24 |
|
| 25 |
loader = PyMuPDFLoader(file_path= file.filename)
|