Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,13 +49,13 @@ class BatchEmbeddingResult(BaseModel):
|
|
| 49 |
|
| 50 |
|
| 51 |
@app.get("/health")
|
| 52 |
-
@limiter.limit("60/minute")
|
| 53 |
def health(request: Request):
|
| 54 |
return {"status": "healthy", "model": "all-MiniLM-L6-v2", "dimensions": 384}
|
| 55 |
|
| 56 |
|
| 57 |
@app.post("/embed", response_model=EmbeddingResult)
|
| 58 |
-
@limiter.limit("60/minute")
|
| 59 |
def embed(request: Request, input: EmbedInput, _: bool = Depends(verify_api_key)):
|
| 60 |
if not input.text.strip():
|
| 61 |
raise HTTPException(400, "Text cannot be empty")
|
|
@@ -64,7 +64,7 @@ def embed(request: Request, input: EmbedInput, _: bool = Depends(verify_api_key)
|
|
| 64 |
|
| 65 |
|
| 66 |
@app.post("/embed/batch", response_model=BatchEmbeddingResult)
|
| 67 |
-
@limiter.limit("20/minute")
|
| 68 |
def embed_batch(request: Request, input: BatchEmbedInput, _: bool = Depends(verify_api_key)):
|
| 69 |
if len(input.texts) > 100:
|
| 70 |
raise HTTPException(400, "Max 100 texts per batch")
|
|
|
|
| 49 |
|
| 50 |
|
| 51 |
@app.get("/health")
|
| 52 |
+
# @limiter.limit("60/minute")
|
| 53 |
def health(request: Request):
|
| 54 |
return {"status": "healthy", "model": "all-MiniLM-L6-v2", "dimensions": 384}
|
| 55 |
|
| 56 |
|
| 57 |
@app.post("/embed", response_model=EmbeddingResult)
|
| 58 |
+
# @limiter.limit("60/minute")
|
| 59 |
def embed(request: Request, input: EmbedInput, _: bool = Depends(verify_api_key)):
|
| 60 |
if not input.text.strip():
|
| 61 |
raise HTTPException(400, "Text cannot be empty")
|
|
|
|
| 64 |
|
| 65 |
|
| 66 |
@app.post("/embed/batch", response_model=BatchEmbeddingResult)
|
| 67 |
+
# @limiter.limit("20/minute")
|
| 68 |
def embed_batch(request: Request, input: BatchEmbedInput, _: bool = Depends(verify_api_key)):
|
| 69 |
if len(input.texts) > 100:
|
| 70 |
raise HTTPException(400, "Max 100 texts per batch")
|