Something went wrong. Try again.
lol
Something went wrong. Try again.
2.2 kB · 122 lines
Nix
at master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123{ lib, buildPythonPackage, fetchFromGitHub,
# build-system setuptools,
# dependencies jsonschema, numpy, opencv-python-headless, pillow, pydantic, pydantic-extra-types, requests, sentencepiece, tiktoken, typing-extensions,
# tests click, fastapi, huggingface-hub, openai, pycountry, pydantic-settings, pytestCheckHook, soundfile, soxr, uvicorn,}:
buildPythonPackage rec { pname = "mistral-common"; version = "1.8.8"; pyproject = true;
src = fetchFromGitHub { owner = "mistralai"; repo = "mistral-common"; tag = "v${version}"; hash = "sha256-rvW2idAqdCZi7+DsHJXczJKbfceZQ4lQyHScLOqxFIc="; };
build-system = [ setuptools ];
dependencies = [ jsonschema numpy opencv-python-headless pillow pydantic pydantic-extra-types requests sentencepiece tiktoken typing-extensions ];
optional-dependencies = lib.fix (self: { opencv = [ opencv-python-headless ]; sentencepiece = [ sentencepiece ]; soundfile = [ soundfile ]; soxr = [ soxr ]; audio = self.soundfile ++ self.soxr; image = self.opencv; hf-hub = [ huggingface-hub ]; server = [ click fastapi pydantic-settings ] ++ fastapi.optional-dependencies.standard; });
pythonImportsCheck = [ "mistral_common" ];
nativeCheckInputs = [ click fastapi huggingface-hub openai pycountry pydantic-settings pytestCheckHook soundfile soxr uvicorn ];
disabledTests = [ # Require internet "test_download_gated_image" "test_image_encoder_formats" "test_image_processing"
# AssertionError: Regex pattern did not match. "test_from_url"
# AssertionError, Extra items in the right set "test_openai_chat_fields" ];
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/v${version}"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ bgamari ]; };}