2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
2024-04-21 15:54:59 +00:00
|
|
|
, accelerate
|
|
|
|
, aiohttp
|
2023-05-24 13:37:59 +00:00
|
|
|
, buildPythonPackage
|
2024-04-21 15:54:59 +00:00
|
|
|
, fastapi
|
2023-05-24 13:37:59 +00:00
|
|
|
, fetchFromGitHub
|
2024-04-21 15:54:59 +00:00
|
|
|
, flask
|
2023-05-24 13:37:59 +00:00
|
|
|
, numpy
|
2024-04-21 15:54:59 +00:00
|
|
|
, pg8000
|
|
|
|
, pillow
|
2023-05-24 13:37:59 +00:00
|
|
|
, pydantic
|
2024-04-21 15:54:59 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, pythonRelaxDepsHook
|
2023-05-24 13:37:59 +00:00
|
|
|
, redis
|
|
|
|
, requests
|
2024-04-21 15:54:59 +00:00
|
|
|
, sentence-transformers
|
|
|
|
, setuptools
|
|
|
|
, sqlalchemy
|
2023-05-24 13:37:59 +00:00
|
|
|
, sqlitedict
|
|
|
|
, tenacity
|
|
|
|
, tiktoken
|
|
|
|
, torch
|
|
|
|
, transformers
|
|
|
|
, uvicorn
|
2024-04-21 15:54:59 +00:00
|
|
|
, 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-04-21 15:54:59 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"pydantic"
|
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
|
];
|
|
|
|
diffusers = [
|
|
|
|
pillow
|
|
|
|
];
|
|
|
|
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"
|
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|