Arafath10 commited on
Commit
8a41bb6
·
verified ·
1 Parent(s): eb04e93

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -25,7 +25,7 @@ app.add_middleware(
25
  allow_headers=["*"],
26
  )
27
 
28
- def chunk_text(text, chunk_size=512):
29
  return [text[i:i + chunk_size] for i in range(0, len(text), chunk_size)]
30
 
31
  @app.post("/get_embeding")
@@ -47,7 +47,7 @@ async def get_embeding(text):
47
  # Optionally, you can average the token embeddings to get a single vector for the sentence
48
  sentence_embedding = torch.mean(embeddings, dim=1)
49
 
50
- #print(sentence_embedding)
51
  all_embeddings.append(sentence_embedding)
52
  return all_embeddings
53
 
 
25
  allow_headers=["*"],
26
  )
27
 
28
+ def chunk_text(text, chunk_size=10):
29
  return [text[i:i + chunk_size] for i in range(0, len(text), chunk_size)]
30
 
31
  @app.post("/get_embeding")
 
47
  # Optionally, you can average the token embeddings to get a single vector for the sentence
48
  sentence_embedding = torch.mean(embeddings, dim=1)
49
 
50
+ print(sentence_embedding)
51
  all_embeddings.append(sentence_embedding)
52
  return all_embeddings
53