-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: tokenize each request individually and increase warmup image size
- Loading branch information
Showing
6 changed files
with
52 additions
and
23 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
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,38 @@ | ||
import pytest | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def flash_qwen2_vl_handle(launcher): | ||
with launcher( | ||
"Qwen/Qwen2-VL-2B-Instruct", | ||
max_input_tokens=40, | ||
max_batch_prefill_tokens=50, | ||
max_total_tokens=51, | ||
) as handle: | ||
yield handle | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
async def flash_qwen2(flash_qwen2_vl_handle): | ||
await flash_qwen2_vl_handle.health(300) | ||
return flash_qwen2_vl_handle.client | ||
|
||
|
||
@pytest.mark.private | ||
async def test_flash_qwen2_vl_simple(flash_qwen2, response_snapshot): | ||
response = await flash_qwen2.chat( | ||
max_tokens=20, | ||
seed=42, | ||
messages=[ | ||
{ | ||
"role": "user", | ||
"content": [ | ||
{"type": "text", "text": "What is the color of the sky?"}, | ||
], | ||
}, | ||
], | ||
) | ||
|
||
assert response.choices[0].message.content == "The correct answer is: blue" | ||
|
||
assert response == response_snapshot |
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