Nightly (#3706)
* Update _utils.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
ff78e784fe
commit
335f9cc095
1 changed files with 4 additions and 2 deletions
|
|
@ -22,6 +22,7 @@ import logging
|
|||
|
||||
UNSLOTH_ENABLE_LOGGING = os.environ.get("UNSLOTH_ENABLE_LOGGING", "0") == "1"
|
||||
|
||||
|
||||
def Version(version):
|
||||
try:
|
||||
new_version = str(version)
|
||||
|
|
@ -30,13 +31,14 @@ def Version(version):
|
|||
raise Exception(str(e))
|
||||
new_version = new_version.group(0).rstrip(".")
|
||||
if new_version != version:
|
||||
new_version += ".1" # Add .1 for dev / alpha / beta / rc
|
||||
new_version += ".1" # Add .1 for dev / alpha / beta / rc
|
||||
return TrueVersion(new_version)
|
||||
except:
|
||||
from inspect import getframeinfo, stack
|
||||
|
||||
caller = getframeinfo(stack()[1][0])
|
||||
raise RuntimeError(
|
||||
f"Unsloth: Could not get version for `{version}`\n"\
|
||||
f"Unsloth: Could not get version for `{version}`\n"
|
||||
f"File name = [{caller.filename}] Line number = [{caller.lineno}]"
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue