geqintan commited on
Commit
c0305bc
·
1 Parent(s): a289a2f
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -34,6 +34,8 @@ class EmbeddingRequest(BaseModel):
34
  @app.post("/v1/embeddings")
35
  async def embeddings(request: EmbeddingRequest, authorization: str = Depends(check_authorization)):
36
  # async def embeddings(request: EmbeddingRequest):
 
 
37
  return request.input
38
  input_text = request.input
39
 
@@ -51,6 +53,7 @@ async def embeddings(request: EmbeddingRequest, authorization: str = Depends(che
51
 
52
  # Calculate embeddings
53
  embeddings = model.encode(input_text)
 
54
 
55
  # Format the embeddings in OpenAI compatible format
56
  data = {
 
34
  @app.post("/v1/embeddings")
35
  async def embeddings(request: EmbeddingRequest, authorization: str = Depends(check_authorization)):
36
  # async def embeddings(request: EmbeddingRequest):
37
+ logger.info("Received request for embeddings")
38
+ return '2222222222'
39
  return request.input
40
  input_text = request.input
41
 
 
53
 
54
  # Calculate embeddings
55
  embeddings = model.encode(input_text)
56
+ q_embeddings = model.encode([instruction+q for q in queries], normalize_embeddings=True)
57
 
58
  # Format the embeddings in OpenAI compatible format
59
  data = {