Skip to content

Commit

Permalink
Make test_batch_embed_semantic_with_async_client deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
WieslerTNG committed Jan 10, 2024
1 parent 778293d commit 0c2e8e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ async def test_batch_embed_semantic_with_async_client(
async_client: AsyncClient, sync_client: Client, num_prompts: int, batch_size: int
):
words = ["car", "elephant", "kitchen sink", "rubber", "sun"]
prompts = [Prompt.from_text(words[random.randint(0, 4)]) for i in range(num_prompts)]
r = random.Random(42)
prompts = list([Prompt.from_text(words[r.randint(0, 4)]) for i in range(num_prompts)])
tokens = [async_client.tokenize(TokenizationRequest(prompt=p.items[0].text, tokens=True, token_ids=False), "luminous-base") for p in prompts]

request = BatchSemanticEmbeddingRequest(
Expand Down

0 comments on commit 0c2e8e2

Please sign in to comment.