Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,12 +11,12 @@ neural_searcher = NeuralSearcher(collection_name=os.getenv('COLLECTION_NAME'))
|
|
| 11 |
|
| 12 |
@app.get("/api/search")
|
| 13 |
async def search(q: str):
|
| 14 |
-
if not q:
|
| 15 |
-
|
| 16 |
|
| 17 |
-
try:
|
| 18 |
data = await neural_searcher.search(text=q)
|
| 19 |
return data
|
| 20 |
-
except:
|
| 21 |
-
|
| 22 |
|
|
|
|
| 11 |
|
| 12 |
@app.get("/api/search")
|
| 13 |
async def search(q: str):
|
| 14 |
+
# if not q:
|
| 15 |
+
# raise HTTPException(status_code=400, detail="Bad request.")
|
| 16 |
|
| 17 |
+
# try:
|
| 18 |
data = await neural_searcher.search(text=q)
|
| 19 |
return data
|
| 20 |
+
# except:
|
| 21 |
+
# raise HTTPException(status_code=500, detail="Internal server error.")
|
| 22 |
|