Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -115,9 +115,9 @@ def bergamot(input_text: list[str] = Query(description="Input list of strings"),
|
|
115 |
@app.get("/embed", operation_id="get_embeddings", description="Embed text", tags=["embed"], summary="Embed text")
|
116 |
def embed(text: str, model: str = EMBEDDING_MODELS[0]):
|
117 |
model = SentenceTransformer(model)
|
118 |
-
embeddings = model.encode(text)
|
119 |
print(embeddings.shape)
|
120 |
-
return {"input": text, "embeddings": embeddings, "shape": embeddings.shape}
|
121 |
|
122 |
# Create an MCP server based on this app
|
123 |
mcp = FastApiMCP(
|
|
|
115 |
@app.get("/embed", operation_id="get_embeddings", description="Embed text", tags=["embed"], summary="Embed text")
|
116 |
def embed(text: str, model: str = EMBEDDING_MODELS[0]):
|
117 |
model = SentenceTransformer(model)
|
118 |
+
embeddings = model.encode(text)
|
119 |
print(embeddings.shape)
|
120 |
+
return {"input": text, "embeddings": embeddings.tolist(), "shape": embeddings.shape}
|
121 |
|
122 |
# Create an MCP server based on this app
|
123 |
mcp = FastApiMCP(
|