TiberiuCristianLeon commited on
Commit
98d0958
·
verified ·
1 Parent(s): 40d6045

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -114,8 +114,8 @@ def bergamot(input_text: list[str] = Query(description="Input list of strings"),
114
 
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("all-MiniLM-L6-v2")
118
- embeddings = model.encode(sentences)
119
  print(embeddings.shape)
120
  return {"input": text, "embeddings": embeddings, "shape": embeddings.shape}
121
 
 
114
 
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