Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
import asyncio
|
| 2 |
import time
|
| 3 |
from fastapi import FastAPI, Request, HTTPException
|
| 4 |
-
from fastapi.responses import JSONResponse
|
| 5 |
from starlette.status import HTTP_504_GATEWAY_TIMEOUT
|
| 6 |
from neural_searcher import NeuralSearcher
|
| 7 |
-
from fastapi.middleware.cors import CORSMiddleware
|
| 8 |
from huggingface_hub import login
|
| 9 |
from config import HUGGING_FACE_API_KEY,COLLECTION_NAME, ALLOWED_ORIGINS, API_KEY
|
| 10 |
|
|
@@ -12,7 +12,7 @@ login(HUGGING_FACE_API_KEY)
|
|
| 12 |
|
| 13 |
app = FastAPI()
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
# REQUEST_TIMEOUT_ERROR = 30
|
| 18 |
|
|
|
|
| 1 |
import asyncio
|
| 2 |
import time
|
| 3 |
from fastapi import FastAPI, Request, HTTPException
|
| 4 |
+
# # from fastapi.responses import JSONResponse
|
| 5 |
from starlette.status import HTTP_504_GATEWAY_TIMEOUT
|
| 6 |
from neural_searcher import NeuralSearcher
|
| 7 |
+
# from fastapi.middleware.cors import CORSMiddleware
|
| 8 |
from huggingface_hub import login
|
| 9 |
from config import HUGGING_FACE_API_KEY,COLLECTION_NAME, ALLOWED_ORIGINS, API_KEY
|
| 10 |
|
|
|
|
| 12 |
|
| 13 |
app = FastAPI()
|
| 14 |
|
| 15 |
+
neural_searcher = NeuralSearcher(collection_name=COLLECTION_NAME)
|
| 16 |
|
| 17 |
# REQUEST_TIMEOUT_ERROR = 30
|
| 18 |
|