Skip to content

Commit

Permalink
test embedder
Browse files Browse the repository at this point in the history
  • Loading branch information
mruwnik committed Oct 16, 2023
1 parent def9b4e commit 00d75f9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions align_data/embeddings/embedding_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def moderation_check(texts: List[str], max_batch_size: int = 4096, tokens_counte
@handle_openai_errors
def _single_batch_compute_openai_embeddings(batch: List[str], **kwargs) -> List[List[float]]:
"""Compute embeddings for a batch."""
print('emebedding', batch[0][:10], 'of len', len(batch))
batch_data = openai.Embedding.create(input=batch, engine=OPENAI_EMBEDDINGS_MODEL, **kwargs).data
return [d["embedding"] for d in batch_data]

Expand Down

0 comments on commit 00d75f9

Please sign in to comment.