Skip to content

Commit

Permalink
Unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Xin Yang <[email protected]>
  • Loading branch information
xyang16 committed Dec 4, 2024
1 parent ce384bc commit 5defaac
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/lora/test_tokenizer_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ async def test_tokenizer_group_lora(sql_lora_files, tokenizer_group_type):
tokenizer_id="gpt2",
enable_lora=True,
max_num_seqs=1,
max_loras=1,
max_input_length=None,
)
lora_request = LoRARequest("1", 1, sql_lora_files)
Expand Down Expand Up @@ -53,3 +54,16 @@ def test_get_lora_tokenizer(sql_lora_files, tmp_path):
lora_request = LoRARequest("1", 1, str(tmp_path))
tokenizer = get_lora_tokenizer(lora_request)
assert not tokenizer


@pytest.mark.parametrize("max_loras", [1, 3])
async def test_lora_tokenizers(max_loras):
tokenizer_group = get_tokenizer_group(
get_tokenizer_pool_config(None),
tokenizer_id="gpt2",
enable_lora=True,
max_num_seqs=2,
max_loras=max_loras,
max_input_length=None,
)
assert tokenizer_group.lora_tokenizers.capacity == max(max_loras, 2)

0 comments on commit 5defaac

Please sign in to comment.