python312Packages.unsloth-zoo: init at 2025.4.1
Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com> Co-authored-by: OTABI Tomoya <tomoya.otabi@gmail.com>
This commit is contained in:
committed by
Gaetan Lepage
co-authored by
Gaétan Lepage
OTABI Tomoya
parent
4dfea7e0c0
commit
81b8490b10
@@ -0,0 +1,86 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchPypi,
|
||||
|
||||
# build-system
|
||||
setuptools,
|
||||
setuptools-scm,
|
||||
|
||||
# dependencies
|
||||
accelerate,
|
||||
cut-cross-entropy,
|
||||
datasets,
|
||||
hf-transfer,
|
||||
huggingface-hub,
|
||||
packaging,
|
||||
peft,
|
||||
psutil,
|
||||
sentencepiece,
|
||||
torch,
|
||||
tqdm,
|
||||
transformers,
|
||||
trl,
|
||||
tyro,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "unsloth-zoo";
|
||||
version = "2025.4.1";
|
||||
pyproject = true;
|
||||
|
||||
# no tags on GitHub
|
||||
src = fetchPypi {
|
||||
pname = "unsloth_zoo";
|
||||
inherit version;
|
||||
hash = "sha256-mRs/NMCNJWT52S7mtbQI332IQR6+/IaL29XmtMOz3fE=";
|
||||
};
|
||||
|
||||
# pyproject.toml requires an obsolete version of protobuf,
|
||||
# but it is not used.
|
||||
# Upstream issue: https://github.com/unslothai/unsloth-zoo/pull/68
|
||||
pythonRelaxDeps = [
|
||||
"protobuf"
|
||||
];
|
||||
|
||||
patches = [
|
||||
# Avoid circular dependency in Nix, since `unsloth` depends on `unsloth-zoo`.
|
||||
./dont-require-unsloth.patch
|
||||
];
|
||||
|
||||
build-system = [
|
||||
setuptools
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
dependencies = [
|
||||
accelerate
|
||||
cut-cross-entropy
|
||||
datasets
|
||||
hf-transfer
|
||||
huggingface-hub
|
||||
packaging
|
||||
peft
|
||||
psutil
|
||||
sentencepiece
|
||||
torch
|
||||
tqdm
|
||||
transformers
|
||||
trl
|
||||
tyro
|
||||
];
|
||||
|
||||
# No tests
|
||||
doCheck = false;
|
||||
|
||||
pythonImportsCheck = [
|
||||
"unsloth_zoo"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Utils for Unsloth";
|
||||
homepage = "https://github.com/unslothai/unsloth_zoo";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ hoh ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
diff --git a/unsloth_zoo/__init__.py b/unsloth_zoo/__init__.py
|
||||
--- a/unsloth_zoo/__init__.py
|
||||
+++ b/unsloth_zoo/__init__.py
|
||||
@@ -17,14 +17,10 @@
|
||||
__version__ = "2025.3.17"
|
||||
|
||||
from importlib.util import find_spec
|
||||
-if find_spec("unsloth") is None:
|
||||
- raise ImportError("Please install Unsloth via `pip install unsloth`!")
|
||||
pass
|
||||
del find_spec
|
||||
|
||||
import os
|
||||
-if not ("UNSLOTH_IS_PRESENT" in os.environ):
|
||||
- raise ImportError("Please install Unsloth via `pip install unsloth`!")
|
||||
pass
|
||||
|
||||
try:
|
||||
@@ -18433,6 +18433,8 @@ self: super: with self; {
|
||||
|
||||
unrpa = callPackage ../development/python-modules/unrpa { };
|
||||
|
||||
unsloth-zoo = callPackage ../development/python-modules/unsloth-zoo { };
|
||||
|
||||
unstructured = callPackage ../development/python-modules/unstructured { };
|
||||
|
||||
unstructured-api-tools = callPackage ../development/python-modules/unstructured-api-tools { };
|
||||
|
||||
Reference in New Issue
Block a user