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 57db939 commit 0f97d54
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 @@ -105,6 +105,7 @@ def moderation_check(texts: List[str], max_texts_num: int = 32) -> List[Moderati
@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 0f97d54

Please sign in to comment.