Skip to content

Commit 684b37d

Browse files
authored
[https://nvbugs/5747938][fix] Use local tokenizer (NVIDIA#10230)
Signed-off-by: Pengyun Lin <[email protected]>
1 parent c5b0f9e commit 684b37d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

examples/serve/aiperf_client.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
aiperf profile \
44
-m TinyLlama-1.1B-Chat-v1.0 \
5-
--tokenizer TinyLlama/TinyLlama-1.1B-Chat-v1.0 \
5+
--tokenizer ${AIPERF_TOKENIZER_PATH:-TinyLlama/TinyLlama-1.1B-Chat-v1.0} \
66
--endpoint-type chat \
77
--random-seed 123 \
88
--synthetic-input-tokens-mean 128 \

tests/unittest/llmapi/apps/_test_trtllm_serve_example.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
import json
22
import os
33
import subprocess
4-
import sys
54
import tempfile
65

76
import pytest
87
import yaml
98

9+
from ..test_llm import get_model_path
1010
from .openai_server import RemoteOpenAIServer
1111

12-
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
13-
from test_llm import get_model_path
14-
1512

1613
@pytest.fixture(scope="module", ids=["TinyLlama-1.1B-Chat"])
1714
def model_name():
@@ -57,15 +54,19 @@ def example_root():
5754
("bash", "curl_completion_client.sh"),
5855
("bash", "aiperf_client.sh"),
5956
("bash", "curl_responses_client.sh")])
60-
def test_trtllm_serve_examples(exe: str, script: str,
57+
def test_trtllm_serve_examples(exe: str, script: str, model_name: str,
6158
server: RemoteOpenAIServer, example_root: str):
6259
client_script = os.path.join(example_root, script)
6360
# CalledProcessError will be raised if any errors occur
61+
custom_env = os.environ.copy()
62+
if script.startswith("aiperf"):
63+
custom_env[""] = get_model_path(model_name)
6464
result = subprocess.run([exe, client_script],
6565
stdout=subprocess.PIPE,
6666
stderr=subprocess.PIPE,
6767
text=True,
68-
check=True)
68+
check=True,
69+
env=custom_env)
6970
if script.startswith("curl"):
7071
# For curl scripts, we expect a JSON response
7172
result_stdout = result.stdout.strip()

0 commit comments

Comments
 (0)