Skip to content

Commit e873cd3

Browse files
author
xusenlin
committed
Fix embedding truncation
1 parent c124579 commit e873cd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/routes/embedding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async def create_embeddings(
5454
for j in range(0, len(texts), SETTINGS.max_client_batch_size):
5555
tasks.append(
5656
client.embeddings.create(
57-
input=texts[j: j + SETTINGS.max_client_batch_size],
57+
input=[text[:510] for text in texts[j: j + SETTINGS.max_client_batch_size]],
5858
model=request.model,
5959
)
6060
)

0 commit comments

Comments
 (0)