File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
fixtures/bloom_sentiment_1 Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "num_virtual_tokens" : 8 ,
3
+ "peft_type" : " PROMPT_TUNING"
4
+ }
Original file line number Diff line number Diff line change
1
+ from pathlib import Path
2
+
3
+ import pytest
4
+
5
+ from vllm_tgis_adapter .grpc .adapters import AdapterStore , validate_adapters
6
+ from vllm_tgis_adapter .grpc .pb .generation_pb2 import (
7
+ BatchedGenerationRequest ,
8
+ )
9
+
10
+ FIXTURES_DIR = Path (__file__ ).parent / "fixtures"
11
+
12
+
13
+ @pytest .mark .asyncio
14
+ async def test_validate_adapters ():
15
+ adapter_name = "bloom_sentiment_1"
16
+ request = BatchedGenerationRequest (
17
+ adapter_id = adapter_name ,
18
+ )
19
+
20
+ adapters = await validate_adapters (
21
+ request , AdapterStore (cache_path = FIXTURES_DIR , adapters = {})
22
+ )
23
+ assert "prompt_adapter_request" in adapters
24
+ assert adapters ["prompt_adapter_request" ].prompt_adapter_name == adapter_name
25
+ adapter_path = adapters ["prompt_adapter_request" ].prompt_adapter_local_path
26
+ assert adapter_path is not None
27
+
28
+ assert Path .exists (Path (adapter_path ) / "adapter_config.json" )
29
+ assert Path .exists (Path (adapter_path ) / "adapter_model.safetensors" )
You can’t perform that action at this time.
0 commit comments