-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #4. timeout was used to avoid a strange behavior where cleanup would hang, but waiting for processing tasks and then workers (sequentially) seems to resolve this.
- Loading branch information
Showing
2 changed files
with
27 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import oaib | ||
|
||
|
||
async def test_long(): | ||
batch = oaib.Auto() | ||
|
||
n = 20 | ||
m = 20 | ||
for i in range(n): | ||
await batch.add( | ||
"chat.completions.create", | ||
model="gpt-4", | ||
max_tokens=4000, | ||
messages=[{"role": "user", "content": "say hello and goodbye " * m}] | ||
) | ||
|
||
chats = await batch.run() | ||
assert len( | ||
chats) == n, f"Chat batch should return {n} results, got {len(chats)}" | ||
|
||
chat = chats.iloc[0].get("result") | ||
assert chat['choices'], "Should get valid chat completions" | ||
|
||
chats |