Skip to content

Commit dc4e3df

Browse files
authored
[misc] fix collect env (#8894)
1 parent 3b00b9c commit dc4e3df

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

collect_env.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,23 @@ def get_neuron_sdk_version(run_lambda):
267267

268268

269269
def get_vllm_version():
270+
version = ""
270271
try:
271272
import vllm
272-
return vllm.__version__ + "@" + vllm.__commit__
273+
version = vllm.__version__
273274
except Exception:
274-
# old version of vllm does not have __commit__
275-
return 'N/A'
276-
275+
pass
276+
commit = ""
277+
try:
278+
import vllm
279+
commit = vllm.__commit__
280+
except Exception:
281+
pass
282+
if version != "" and commit != "":
283+
return f"{version}@{commit}"
284+
if version == "" and commit == "":
285+
return "N/A"
286+
return version or commit
277287

278288
def summarize_vllm_build_flags():
279289
# This could be a static method if the flags are constant, or dynamic if you need to check environment variables, etc.

0 commit comments

Comments
 (0)