Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into upstream-sync-2024-07-01
Browse files Browse the repository at this point in the history
  • Loading branch information
robertgshaw2-neuralmagic authored Jul 3, 2024
2 parents cd2aa72 + 53347d5 commit f43cb06
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This file has been modified by Neural Magic

# nm-vllm commit id, generated by setup.py
venv/commit_id.py

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
12 changes: 4 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,12 @@ def embed_commit_hash():
try:
commit_id = subprocess.check_output(["git", "rev-parse", "HEAD"],
encoding="utf-8").strip()
commit_contents = f'__commit__ = "{commit_id}"\n'

version_file = os.path.join(ROOT_DIR, "vllm", "version.py")
with open(version_file, encoding="utf-8") as f:
version_contents = f.read()

version_contents = version_contents.replace("COMMIT_HASH_PLACEHOLDER",
f"{commit_id}")

version_file = os.path.join(ROOT_DIR, "vllm", "commit_id.py")
with open(version_file, "w", encoding="utf-8") as f:
f.write(version_contents)
f.write(commit_contents)

except subprocess.CalledProcessError as e:
warnings.warn(f"failed to get commit hash:\n{e}",
RuntimeWarning,
Expand Down
11 changes: 11 additions & 0 deletions vllm/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# UPSTREAM SYNC: take downstream
import warnings

try:
import vllm.commit_id
__commit__ = vllm.commit_id.__commit__
except Exception as e:
warnings.warn(f"failed to read commit hash:\n{e}",
RuntimeWarning,
stacklevel=2)
__commit__ = "COMMIT_HASH_PLACEHOLDER"

__version__ = "0.5.1"
__commit__ = "07abe05bea44b7f4cc8c567527063c3992a8f301"

0 comments on commit f43cb06

Please sign in to comment.