2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
accelerate,
|
|
|
|
aiohttp,
|
|
|
|
buildPythonPackage,
|
|
|
|
fastapi,
|
|
|
|
fetchFromGitHub,
|
|
|
|
flask,
|
|
|
|
numpy,
|
|
|
|
pg8000,
|
|
|
|
pillow,
|
|
|
|
pydantic,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pythonRelaxDepsHook,
|
|
|
|
redis,
|
|
|
|
requests,
|
|
|
|
sentence-transformers,
|
|
|
|
setuptools,
|
|
|
|
sqlalchemy,
|
|
|
|
sqlitedict,
|
|
|
|
tenacity,
|
|
|
|
tiktoken,
|
|
|
|
torch,
|
|
|
|
transformers,
|
|
|
|
uvicorn,
|
|
|
|
xxhash,
|
2023-05-24 13:37:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "manifest-ml";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.1.9";
|
|
|
|
pyproject = true;
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "HazyResearch";
|
|
|
|
repo = "manifest";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-6m1XZOXzflBYyq9+PinbrW+zqvNGFN/aRDHH1b2Me5E=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonRelaxDeps = [ "pydantic" ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
build-system = [
|
|
|
|
pythonRelaxDepsHook
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
dependencies = [
|
2023-05-24 13:37:59 +00:00
|
|
|
numpy
|
|
|
|
pydantic
|
|
|
|
redis
|
|
|
|
requests
|
|
|
|
aiohttp
|
|
|
|
sqlitedict
|
|
|
|
tenacity
|
|
|
|
tiktoken
|
|
|
|
xxhash
|
2024-04-21 15:54:59 +00:00
|
|
|
];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
passthru.optional-dependencies = {
|
|
|
|
api = [
|
|
|
|
accelerate
|
|
|
|
# deepspeed
|
|
|
|
# diffusers
|
|
|
|
flask
|
|
|
|
sentence-transformers
|
|
|
|
torch
|
|
|
|
transformers
|
|
|
|
];
|
|
|
|
app = [
|
|
|
|
fastapi
|
|
|
|
uvicorn
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
diffusers = [ pillow ];
|
2023-05-24 13:37:59 +00:00
|
|
|
gcp = [
|
|
|
|
pg8000
|
|
|
|
# cloud-sql-python-connector
|
|
|
|
sqlalchemy
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
2024-04-21 15:54:59 +00:00
|
|
|
] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
# this file tries importing `deepspeed`, which is not yet packaged in nixpkgs
|
|
|
|
"--ignore=tests/test_huggingface_api.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
2024-04-21 15:54:59 +00:00
|
|
|
# Tests require DB access
|
2023-05-24 13:37:59 +00:00
|
|
|
"test_init"
|
|
|
|
"test_key_get_and_set"
|
|
|
|
"test_get"
|
2024-04-21 15:54:59 +00:00
|
|
|
# Tests require network access
|
|
|
|
"test_abatch_run"
|
|
|
|
"test_batch_run"
|
2023-05-24 13:37:59 +00:00
|
|
|
"test_retry_handling"
|
2024-04-21 15:54:59 +00:00
|
|
|
"test_run_chat"
|
|
|
|
"test_run"
|
|
|
|
"test_score_run"
|
2023-10-09 19:29:22 +00:00
|
|
|
# Test is time-senstive
|
|
|
|
"test_timing"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "manifest" ];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Manifest for Prompting Foundation Models";
|
|
|
|
homepage = "https://github.com/HazyResearch/manifest";
|
|
|
|
changelog = "https://github.com/HazyResearch/manifest/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ natsukium ];
|
|
|
|
};
|
|
|
|
}
|