Skip to content

Commit af6afc9

Browse files
committed
Update offline_lora_inference.py to use tpu_inference.envs
1 parent e71cd3f commit af6afc9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/offline_lora_inference.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
33

4-
import os
54
import time
65

7-
import vllm.envs as envs
6+
import tpu_inference.envs as envs
7+
import vllm.envs as vllm_envs
88
from vllm import LLM, EngineArgs
99
from vllm.lora.request import LoRARequest
1010
from vllm.utils.argparse_utils import FlexibleArgumentParser
@@ -55,13 +55,13 @@ def main(args: dict):
5555
"lora_adapter_3", 3,
5656
"Username6568/Qwen2.5-3B-Instruct-1_plus_1_equals_3_adapter")
5757

58-
if envs.VLLM_TORCH_PROFILER_DIR is not None:
58+
if vllm_envs.VLLM_TORCH_PROFILER_DIR is not None:
5959
llm.start_profile()
6060
start = time.perf_counter()
6161
outputs = llm.generate(prompt,
6262
sampling_params=sampling_params,
6363
lora_request=lora_request)
64-
if envs.VLLM_TORCH_PROFILER_DIR is not None:
64+
if vllm_envs.VLLM_TORCH_PROFILER_DIR is not None:
6565
llm.stop_profile()
6666

6767
# Print the outputs.
@@ -77,7 +77,7 @@ def main(args: dict):
7777

7878
if __name__ == "__main__":
7979
# Skip long warmup for local simple test.
80-
os.environ['SKIP_JAX_PRECOMPILE'] = '1'
80+
envs.environment_variables['SKIP_JAX_PRECOMPILE'] = lambda: True
8181

8282
parser = create_parser()
8383
args: dict = vars(parser.parse_args())

0 commit comments

Comments
 (0)