Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AutoRound
<h3> Advanced Quantization Algorithm for LLMs</h3>

[![python](https://img.shields.io/badge/python-3.10%2B-blue)](https://github.com/intel/auto-round)
[![version](https://img.shields.io/badge/release-0.7.1-green)](https://github.com/intel/auto-round)
[![version](https://img.shields.io/badge/release-0.8.0-green)](https://github.com/intel/auto-round)
[![license](https://img.shields.io/badge/license-Apache%202-9C27B0)](https://github.com/intel/auto-round/blob/main/LICENSE)
<a href="https://huggingface.co/Intel">
<img alt="Model Checkpoints" src="https://img.shields.io/badge/%F0%9F%A4%97%20HF-Models-F57C00">
Expand Down
2 changes: 1 addition & 1 deletion auto_round/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"""Intel® auto-round: An open-source Python library
supporting popular model weight only compression based on signround."""

__version__ = "0.8.0.dev"
__version__ = "0.9.0"
28 changes: 25 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import re
import subprocess
import sys
from functools import lru_cache
from io import open
Expand All @@ -15,14 +16,35 @@
except Exception as error:
assert False, "Error: Could not open '%s' due %s\n" % (filepath, error)

version = __version__

# All BUILD_* flags are initially set to `False`` and
# will be updated to `True` if the corresponding environment check passes.
PYPI_RELEASE = os.environ.get("PYPI_RELEASE", None)
BUILD_HPU_ONLY = os.environ.get("BUILD_HPU_ONLY", "0") == "1"


def is_commit_on_tag():
try:
result = subprocess.run(
["git", "describe", "--exact-match", "--tags"], capture_output=True, text=True, check=True
)
tag_name = result.stdout.strip()
return tag_name
except subprocess.CalledProcessError:
return False


def get_build_version():
if is_commit_on_tag():
return __version__
try:
result = subprocess.run(["git", "describe", "--tags"], capture_output=True, text=True, check=True)
distance = result.stdout.strip().split("-")[-2]
commit = result.stdout.strip().split("-")[-1]
return f"{__version__}.dev{distance}+{commit}"
except subprocess.CalledProcessError:
return __version__


@lru_cache(None)
def is_habana_framework_installed():
"""Check if Habana framework is installed.
Expand Down Expand Up @@ -143,7 +165,7 @@ def fetch_requirements(path):
setup(
name=package_name,
author="Intel AIPT Team",
version=version,
version=get_build_version(),
author_email="wenhua.cheng@intel.com, weiwei1.zhang@intel.com, heng.guo@intel.com",
description="Repository of AutoRound: Advanced Weight-Only Quantization Algorithm for LLMs",
long_description=open("README.md", "r", encoding="utf-8").read(),
Expand Down