2023-08-31 14:01:35 +09:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, accelerate
|
|
|
|
, attrs
|
|
|
|
, bitsandbytes
|
2023-11-21 12:10:47 +09:00
|
|
|
, bentoml
|
2023-08-31 14:01:35 +09:00
|
|
|
, cattrs
|
2023-11-21 12:10:47 +09:00
|
|
|
, click-option-group
|
2023-08-31 14:01:35 +09:00
|
|
|
, datasets
|
2023-11-21 12:10:47 +09:00
|
|
|
, deepmerge
|
2023-08-31 14:01:35 +09:00
|
|
|
, hatch-fancy-pypi-readme
|
|
|
|
, hatch-vcs
|
|
|
|
, hatchling
|
|
|
|
, inflection
|
|
|
|
, mypy-extensions
|
|
|
|
, orjson
|
|
|
|
, peft
|
|
|
|
, transformers
|
|
|
|
, typing-extensions
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "openllm-core";
|
2023-12-23 14:49:25 +01:00
|
|
|
version = "0.4.41";
|
2023-10-22 17:08:31 +09:00
|
|
|
pyproject = true;
|
2023-08-31 14:01:35 +09:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bentoml";
|
|
|
|
repo = "OpenLLM";
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-12-23 14:49:25 +01:00
|
|
|
hash = "sha256-9mr6sw4/h5cYSmo1CDT2SKq4NVz1ZcoyqnYOwhlfaiQ=";
|
2023-08-31 14:01:35 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "source/openllm-core";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
hatch-fancy-pypi-readme
|
|
|
|
hatch-vcs
|
|
|
|
hatchling
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
attrs
|
|
|
|
cattrs
|
2023-11-21 12:10:47 +09:00
|
|
|
# not listed in pyproject.toml, but required at runtime
|
|
|
|
click-option-group
|
|
|
|
deepmerge
|
2023-08-31 14:01:35 +09:00
|
|
|
inflection
|
|
|
|
mypy-extensions
|
|
|
|
orjson
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
|
|
|
passthru.optional-dependencies = {
|
|
|
|
vllm = [
|
|
|
|
# vllm
|
|
|
|
];
|
2023-11-21 12:10:47 +09:00
|
|
|
bentoml = [
|
|
|
|
bentoml
|
|
|
|
];
|
2023-08-31 14:01:35 +09:00
|
|
|
fine-tune = [
|
|
|
|
accelerate
|
|
|
|
bitsandbytes
|
|
|
|
datasets
|
|
|
|
peft
|
|
|
|
transformers
|
|
|
|
# trl
|
|
|
|
] ++ transformers.optional-dependencies.torch
|
|
|
|
++ transformers.optional-dependencies.tokenizers
|
|
|
|
++ transformers.optional-dependencies.accelerate;
|
2023-11-21 12:10:47 +09:00
|
|
|
full = with passthru.optional-dependencies; ( vllm ++ bentoml ++ fine-tune );
|
2023-08-31 14:01:35 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
# there is no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "openllm_core" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Core components for OpenLLM";
|
|
|
|
homepage = "https://github.com/bentoml/OpenLLM/tree/main/openllm-core";
|
|
|
|
changelog = "https://github.com/bentoml/OpenLLM/blob/${src.rev}/CHANGELOG.md";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ natsukium ];
|
|
|
|
};
|
|
|
|
}
|