Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
2.4 kB · 123 lines
Nix
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder,
# build-system setuptools,
# dependencies datasets, huggingface-hub, numpy, packaging, torch, transformers,
# optional-dependencies diffusers, h5py, onnx, onnxruntime, protobuf, tensorflow, tf2onnx, timm,}:
buildPythonPackage rec { pname = "optimum"; version = "1.26.1"; pyproject = true;
disabled = pythonOlder "3.9";
src = fetchFromGitHub { owner = "huggingface"; repo = "optimum"; tag = "v${version}"; hash = "sha256-GfUlvz7b0DlqBPibndRzUkszGnbYXg6E8u144ZFAZxA="; };
build-system = [ setuptools ];
pythonRelaxDeps = [ "transformers" ];
dependencies = [ huggingface-hub numpy packaging torch transformers ] ++ transformers.optional-dependencies.sentencepiece;
optional-dependencies = { onnxruntime = [ onnx datasets protobuf onnxruntime ]; exporters = [ onnx timm onnxruntime protobuf ]; exporters-tf = [ onnx timm h5py tf2onnx onnxruntime numpy datasets tensorflow ]; diffusers = [ diffusers ]; intel = [ # optimum-intel ]; openvino = [ # optimum-intel ]; # ++ optimum-intel.optional-dependencies.openvino; nncf = [ # optimum-intel ]; # ++ optimum-intel.optional-dependencies.nncf; neural-compressor = [ # optimum-intel ]; # ++ optimum-intel.optional-dependencies.neural-compressor; graphcore = [ # optimum-graphcore ]; habana = [ transformers # optimum-habana ]; neuron = [ # optimum-neuron ]; # ++ optimum-neuron.optional-dependencies.neuron; neuronx = [ # optimum-neuron ]; # ++ optimum-neuron.optional-dependencies.neuronx; furiosa = [ # optimum-furiosa ]; };
# almost all tests try to connect to https://huggingface.co doCheck = false;
pythonImportsCheck = [ "optimum" ];
meta = { description = "Accelerate training and inference of 🤗 Transformers and 🤗 Diffusers with easy to use hardware optimization tools"; mainProgram = "optimum-cli"; homepage = "https://github.com/huggingface/optimum"; changelog = "https://github.com/huggingface/optimum/releases/tag/${src.tag}"; license = lib.licenses.asl20; maintainers = with lib.maintainers; [ natsukium ]; };}