Something went wrong. Try again.
Nix Packages collection & NixOS github.com/NixOS/nixpkgs
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138{ lib, buildPythonPackage, fetchFromGitHub,
# build-system setuptools,
# dependencies jsonschema, numpy, pillow, pydantic, pydantic-extra-types, requests, tiktoken, typing-extensions,
# optional-dependencies click, fastapi, huggingface-hub, jinja2, llguidance, opencv-python-headless, pydantic-settings, pytest-xdist, pytestCheckHook, sentencepiece, soundfile, soxr, uvloop,
# tests openai, pycountry, uvicorn,}:
buildPythonPackage (finalAttrs: { pname = "mistral-common"; version = "1.12.0"; pyproject = true; __structuredAttrs = true;
src = fetchFromGitHub { owner = "mistralai"; repo = "mistral-common"; tag = "v${finalAttrs.version}"; hash = "sha256-XrSlPG7t1BJ+kcoMlZMwVRnKfNS656GlnatebgapRMY="; };
build-system = [ setuptools ];
dependencies = [ jsonschema numpy pillow pydantic pydantic-extra-types requests tiktoken typing-extensions ];
optional-dependencies = let self = finalAttrs.finalPackage.optional-dependencies; in { opencv = [ opencv-python-headless ]; sentencepiece = [ sentencepiece ]; soundfile = [ soundfile ]; soxr = [ soxr ]; audio = self.soundfile ++ self.soxr; image = self.opencv; guidance = [ jinja2 llguidance ]; hf-hub = [ huggingface-hub ]; server = [ click fastapi pydantic-settings uvloop ] ++ fastapi.optional-dependencies.standard; all = self.opencv ++ self.sentencepiece ++ self.audio ++ self.image ++ self.guidance ++ self.hf-hub ++ self.server; };
pythonImportsCheck = [ "mistral_common" ];
nativeCheckInputs = [ openai pycountry pytest-xdist pytestCheckHook uvicorn ] ++ finalAttrs.finalPackage.optional-dependencies.all;
disabledTests = [ # AssertionError, Extra items in the right set "test_openai_chat_fields"
# AssertionError: assert 0.028677442591911916 < 0.005 "test_audio_base64" ];
meta = { description = "Tools to help you work with Mistral models"; homepage = "https://github.com/mistralai/mistral-common"; changelog = "https://github.com/mistralai/mistral-common/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ bgamari ]; };})