-
-
Notifications
You must be signed in to change notification settings - Fork 899
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix inference when no chat_template is set, fix unsloth dora check (#…
…2092) * fix inference when no chat_template is set, fix unsloth dora check * remove old unsloth version check * update docs on installing unsloth
- Loading branch information
Showing
5 changed files
with
46 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# noqa | ||
# pylint: skip-file | ||
try: | ||
import torch | ||
except ImportError: | ||
raise ImportError("Install torch via `pip install torch`") | ||
from packaging.version import Version as V | ||
|
||
v = V(torch.__version__) | ||
cuda = str(torch.version.cuda) | ||
is_ampere = torch.cuda.get_device_capability()[0] >= 8 | ||
if cuda != "12.1" and cuda != "11.8" and cuda != "12.4": | ||
raise RuntimeError(f"CUDA = {cuda} not supported!") | ||
if v <= V("2.1.0"): | ||
raise RuntimeError(f"Torch = {v} too old!") | ||
elif v <= V("2.1.1"): | ||
x = "cu{}{}-torch211" | ||
elif v <= V("2.1.2"): | ||
x = "cu{}{}-torch212" | ||
elif v < V("2.3.0"): | ||
x = "cu{}{}-torch220" | ||
elif v < V("2.4.0"): | ||
x = "cu{}{}-torch230" | ||
elif v < V("2.5.0"): | ||
x = "cu{}{}-torch240" | ||
elif v < V("2.6.0"): | ||
x = "cu{}{}-torch250" | ||
else: | ||
raise RuntimeError(f"Torch = {v} too new!") | ||
x = x.format(cuda.replace(".", ""), "-ampere" if is_ampere else "") | ||
print( | ||
f'pip install unsloth-zoo && pip install --no-deps "unsloth[{x}] @ git+https://github.com/unslothai/unsloth.git"' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters