Spaces:
Running
Running
Soumik Bose commited on
Commit ·
14cc6a3
1
Parent(s): 3b07301
go
Browse files
main.py
CHANGED
|
@@ -175,25 +175,6 @@ async def create_embeddings(request: EmbedRequest):
|
|
| 175 |
logger.error(f"Inference error: {e}")
|
| 176 |
raise HTTPException(status_code=500, detail=str(e))
|
| 177 |
|
| 178 |
-
@app.
|
| 179 |
-
async def
|
| 180 |
-
"""
|
| 181 |
-
Experimental: Reverse vector to text.
|
| 182 |
-
|
| 183 |
-
NOTE: Mathematically, standard embedding models (BERT, BGE) are NOT reversible
|
| 184 |
-
because they are lossy compression algorithms.
|
| 185 |
-
|
| 186 |
-
To retrieve text from a vector, you must use a Vector Database (retrieval),
|
| 187 |
-
not a direct model inversion.
|
| 188 |
-
"""
|
| 189 |
-
# In a real scenario, this would look like:
|
| 190 |
-
# result = vector_db.search(vector=request.vector, top_k=1)
|
| 191 |
-
# return {"text": result.text}
|
| 192 |
-
|
| 193 |
-
raise HTTPException(
|
| 194 |
-
status_code=501,
|
| 195 |
-
detail=(
|
| 196 |
-
"De-embedding (Vector-to-Text) is not possible with standalone embedding models. "
|
| 197 |
-
"This endpoint requires a connected Vector Database to perform a similarity search."
|
| 198 |
-
)
|
| 199 |
-
)
|
|
|
|
| 175 |
logger.error(f"Inference error: {e}")
|
| 176 |
raise HTTPException(status_code=500, detail=str(e))
|
| 177 |
|
| 178 |
+
@app.get("/ping")
|
| 179 |
+
async def ping():
|
| 180 |
+
return {"message": "embed-api is alive!"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|