diff options
Diffstat (limited to 'machinelearning.scm')
-rw-r--r-- | machinelearning.scm | 373 |
1 files changed, 58 insertions, 315 deletions
diff --git a/machinelearning.scm b/machinelearning.scm index 63fd822..da20980 100644 --- a/machinelearning.scm +++ b/machinelearning.scm @@ -105,265 +105,6 @@ (description "This package provides a library for installing Python wheels.") (license #f))) -(define-public python-rclip - (package - (name "rclip") - (version "1.10.2") - (source - (origin - (method url-fetch) - (uri (pypi-uri "rclip" version)) - (sha256 - (base32 "05cv5hp63x6ym12s1a5lb7najjyzrqk40rvmj8x2y32hxsf6ampn")))) - (build-system pyproject-build-system) - (native-inputs (list python-poetry-core-1.9.0)) - (propagated-inputs (list python-open-clip-torch - python-pillow - python-requests - python-pytorch - python-torchvision - python-tqdm)) - (arguments - '( #:phases - (modify-phases %standard-phases - (delete 'check) ;#TODO: see why this is broke - (delete 'sanity-check) ;TODO: Fix broken sanity-check - ))) - (home-page "https://github.com/yurijmikhalevich/rclip") - (synopsis "AI-Powered Command-Line Photo Search Tool") - (description "AI-Powered Command-Line Photo Search Tool") - (license license:expat))) - - -(define-public python-open-clip-torch - (package - (name "python-open-clip-torch") - (version "2.24.0") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/mlfoundations/open_clip") - (commit (string-append "v" version)) - )) - (file-name (git-file-name name version)) - (sha256 - (base32 "0mby632z2qpahb8pd8cmn14bz4w1q0cngz7s6rmx2qwfg2fxf1ms")))) - (build-system pyproject-build-system) - (inputs (list python-ftfy - python-huggingface-hub - python-protobuf - python-regex - python-sentencepiece - python-timm - python-pytorch - python-torchvision - python-tqdm - python-wheel - )) - (arguments - '( #:phases - (modify-phases %standard-phases - (delete 'check) ;Networking required for checks, so disable them - (delete 'sanity-check) ;TODO: Fix broken sanity-check - ))) - (home-page "https://github.com/mlfoundations/open_clip") - (synopsis "OpenCLIP") - (description "@code{OpenCLIP}") - (license license:expat))) - -(define-public python-ftfy - (package - (name "python-ftfy") - ;(version "6.2.0") - (version "5.5.1") - (source - (origin - (method url-fetch) - (uri (pypi-uri "ftfy" version)) - (sha256 - ;(base32 "1h3m9i1c2qp874fpg62gcp39yqdhc5mrsqd29ja9gvr5f0y18hjy")))) - (base32 "1ci6xrj4g01a97nymxpv9nj820nlmgzc4ybaz9k46i6bnxzpax7s")))) - (build-system pyproject-build-system) - (native-inputs (list poetry)) - (propagated-inputs (list python-wcwidth)) - (arguments - '( #:phases - (modify-phases %standard-phases - (delete 'check) - ))) - (home-page "") - (synopsis "Fixes mojibake and other problems with Unicode, after the fact") - (description - "Fixes mojibake and other problems with Unicode, after the fact") - (license license:asl2.0))) - -(define-public python-expecttest - (package - (name "python-expecttest") - (version "0.2.1") - (source - (origin - (method url-fetch) - (uri (pypi-uri "expecttest" version)) - (sha256 - (base32 "1xbkpcp3477ccgr4ks16v0j22i7a939bs2rajvk0cigqlvw1qaz5")))) - (build-system pyproject-build-system) - (arguments - (list - #:phases #~(modify-phases %standard-phases (delete 'check)))) - (native-inputs (list poetry)) - (home-page "https://github.com/ezyang/expecttest") - (synopsis "") - (description "") - (license license:expat))) - -(define-public python-timm - (package - (name "python-timm") - (version "0.9.16") - (source - (origin - (method url-fetch) - (uri (pypi-uri "timm" version)) - (sha256 - (base32 "1rkif1mkgryirn78aw9rkwplf3hzfqbw3c0slwqxynnmfprm87l9")))) - (build-system pyproject-build-system) - (arguments - (list - #:phases - #~(modify-phases %standard-phases - (delete 'check) ;takes FOREVER for some reason - (delete 'sanity-check ;Crashes; #TODO: fix this - )))) - (inputs (list python-huggingface-hub python-pyyaml - python-safetensors python-pytorch - python-torchvision python-pdm-backend - - python-pytest python-pytest-timeout python-expecttest python-pytest-xdist)) - (home-page "https://github.com/huggingface/pytorch-image-models") - (synopsis "PyTorch Image Models") - (description "@code{PyTorch} Image Models") - (license license:asl2.0))) - -(define-public rust-memmap2-0.5 - (package - (name "rust-memmap2") - (version "0.5.0") - (source - (origin - (method url-fetch) - (uri (crate-uri "memmap2" version)) - (file-name (string-append name "-" version ".tar.gz")) - (sha256 - (base32 "0vp9pxd20gyq8196v73chxdw6gfxz3g4lkdkvffd5slgawds2is6")))) - (build-system cargo-build-system) - (arguments - `(#:cargo-inputs (("rust-libc" ,rust-libc-0.2) - ("rust-stable-deref-trait" ,rust-stable-deref-trait-1)) - #:cargo-development-inputs (("rust-owning-ref" ,rust-owning-ref-0.4) - ("rust-tempdir" ,rust-tempdir-0.3)))) - (home-page "https://github.com/RazrFalcon/memmap2-rs") - (synopsis "Cross-platform Rust API for memory-mapped file IO") - (description "Cross-platform Rust API for memory-mapped file IO") - (license (list license:expat license:asl2.0)))) - -(define-public rust-safetensors-0.4 - (package - (name "rust-safetensors") - (version "0.4.2") - (source - (origin - (method url-fetch) - (uri (crate-uri "safetensors" version)) - (file-name (string-append name "-" version ".tar.gz")) - (sha256 - (base32 "1vb9wsmsm7wfyvkl795wpc2iiwa3mx0vqhhym2q6yhrlzdmhx64d")))) - (build-system cargo-build-system) - (arguments - `(#:cargo-inputs (("rust-serde" ,rust-serde-1) - ("rust-serde-json" ,rust-serde-json-1)) - #:cargo-development-inputs (("rust-criterion" ,rust-criterion-0.4) - ("rust-memmap2" ,rust-memmap2-0.5) - ("rust-proptest" ,rust-proptest-1)))) - (home-page "https://github.com/huggingface/safetensors") - (synopsis - "Provides functions to read and write safetensors which aim to be safer than - their PyTorch counterpart. - The format is 8 bytes which is an unsized int, being the size of a JSON header, - the JSON header refers the `dtype` the `shape` and `data_offsets` which are the offsets - for the values in the rest of the file. - ") - (description - "This package provides functions to read and write safetensors which aim to be - safer than their @code{PyTorch} counterpart. The format is 8 bytes which is an - unsized int, being the size of a JSON header, the JSON header refers the `dtype` - the `shape` and `data_offsets` which are the offsets for the values in the rest - of the file.") - (license license:asl2.0))) - -(define-public python-safetensors - (package - (name "python-safetensors") - (version "0.4.2") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/huggingface/safetensors.git") - (commit (string-append "v" version)) - )) - (file-name (git-file-name name version)) - (sha256 - (base32 "1gs0ivd5m95jyy6j1yqvm8pq068xsk405gv0nwq2821vr4ix9lw5")))) - (build-system cargo-build-system) - (arguments - (list - #:imported-modules `(,@%cargo-build-system-modules - ,@%pyproject-build-system-modules) - #:modules '((guix build cargo-build-system) - ((guix build pyproject-build-system) #:prefix py:) - (guix build utils)) - #:phases - #~(modify-phases %standard-phases - (add-before 'configure 'get-safetensor-cargo - (lambda _ - (copy-recursively "bindings/python/Cargo.toml" "./Cargo.toml") - (substitute* "./Cargo.toml" ( ("name = \"safetensors_rust\"") "name = \"safetensors_rust\"\npath = \"bindings/python//src/lib.rs\"" ) ) - (substitute* "./Cargo.toml" ( ("path = \"../../safetensors\"") "path = \"safetensors\"" ) ) - )) - (add-after 'prepare-python-module 'build-python-module - (assoc-ref py:%standard-phases 'build)) - (add-after 'build-python-module 'install-python-module - (assoc-ref py:%standard-phases 'install)) - (add-after 'compress-documentation 'remove-bloat - (lambda _ - (delete-file-recursively "target") - (delete-file-recursively "attacks") - (delete-file-recursively "safetensors") - )) - ) - - #:cargo-inputs - `( - ;("rust-safetensors" ,rust-safetensors-0.4) - ("rust-pyo3" ,rust-pyo3-0.20) - ("rust-criterion" ,rust-criterion-0.5) - ("rust-memmap2" ,rust-memmap2-0.5) - ("rust-proptest" ,rust-proptest-1) - ("rust-serde" ,rust-serde-1) - ("rust-serde-json" ,rust-serde-json-1) - ) - #:install-source? #false)) - (inputs - (list maturin rust-safetensors-0.4 python-wheel)) - (native-inputs - (list python-wrapper)) - (home-page "https://github.com/huggingface/safetensors") - (synopsis "a new simple format for storing tensors safely") - (description "This repository implements a new simple format for storing tensors safely (as opposed to pickle) and that is still fast (zero-copy).") - (license license:asl2.0))) - (define-public ggml (package (name "ggml") @@ -453,7 +194,7 @@ (define-public stable-diffusion-cpp (package (name "stable-diffusion-cpp") - (version "dcf91f9e0f2cbf9da472ee2a556751ed4bab2d2a") + (version "10feacf031cccc19b7f1257048ec32b778a01dbf") (source (origin (method git-fetch) @@ -464,9 +205,9 @@ (file-name (git-file-name name version)) (sha256 (base32 - "0dhh4m710kiwrs4yc64saab5rkjg5psxr15cm6fsl64pv4ssk7v5")))) + "1l66r2xxcrlfqkl9dl8xw30rv99nlvzdzfyg4n4zlx6xmbbr5d9f")))) (build-system cmake-build-system) - (inputs (list openblas)) + (inputs (list openblas git-minimal )) (arguments '( #:tests? #f @@ -494,56 +235,57 @@ (let ((bin (string-append (assoc-ref outputs "out") "/bin/sd"))) (when (file-exists? bin) (rename-file bin (string-append (dirname bin) "/sd-vulkan"))))))))) - (inputs (list vulkan-headers vulkan-loader shaderc libomp)))) + (inputs (list vulkan-headers vulkan-loader shaderc libomp git-minimal)) + )) (define-public exiv2-staticlibs (package (inherit exiv2) - (arguments - `(#:test-target "tests" - #:configure-flags (list "-DEXIV2_BUILD_UNIT_TESTS=ON" - ;; darktable needs BMFF to support - ;; CR3 files. - "-DEXIV2_ENABLE_BMFF=ON") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'patch-gcc-reference - (lambda _ - ;; _GLIBCXX_ASSERTIONS brings reference to GCC. - (substitute* "cmake/compilerFlags.cmake" - (("add_compile_options[(]-Wp,-D_GLIBCXX_ASSERTIONS[)]") - "")))) - - ,@(if (or (target-ppc64le?) - (target-aarch64?) - (target-riscv64?)) - '((add-after 'unpack 'adjust-tests - (lambda _ - ;; Adjust test on ppc64 and aarch64, where no exception - ;; is raised and thus the return value is different. See - ;; <https://github.com/Exiv2/exiv2/issues/365> and - ;; <https://github.com/Exiv2/exiv2/issues/933>. - (substitute* "tests/bugfixes/github/test_CVE_2018_12265.py" - (("\\$uncaught_exception \\$addition_overflow_message\n") "") - (("retval = \\[1\\]") "retval = [0]"))))) - '())))) + (arguments + `(#:test-target "tests" + #:configure-flags (list "-DEXIV2_BUILD_UNIT_TESTS=ON" + ;; darktable needs BMFF to support + ;; CR3 files. + "-DEXIV2_ENABLE_BMFF=ON") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-gcc-reference + (lambda _ + ;; _GLIBCXX_ASSERTIONS brings reference to GCC. + (substitute* "cmake/compilerFlags.cmake" + (("add_compile_options[(]-Wp,-D_GLIBCXX_ASSERTIONS[)]") + "")))) + + ,@(if (or (target-ppc64le?) + (target-aarch64?) + (target-riscv64?)) + '((add-after 'unpack 'adjust-tests + (lambda _ + ;; Adjust test on ppc64 and aarch64, where no exception + ;; is raised and thus the return value is different. See + ;; <https://github.com/Exiv2/exiv2/issues/365> and + ;; <https://github.com/Exiv2/exiv2/issues/933>. + (substitute* "tests/bugfixes/github/test_CVE_2018_12265.py" + (("\\$uncaught_exception \\$addition_overflow_message\n") "") + (("retval = \\[1\\]") "retval = [0]"))))) + '())))) )) (define-public stable-diffusion-cpp-gui-wx (package - (name "stable-diffusion-cpp-gui-wx") - (version "6f604f836961002fbce72a205c1e6cc6d6a531e9") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/fszontagh/sd.cpp.gui.wx") - (recursive? #t) - (commit version))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "035zqhjnwdb07ag4chj9zijl70wk81kinqwlnvs9ixb2fzl1z374")))) + (name "stable-diffusion-cpp-gui-wx") + (version "6f604f836961002fbce72a205c1e6cc6d6a531e9") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/fszontagh/sd.cpp.gui.wx") + (recursive? #t) + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "035zqhjnwdb07ag4chj9zijl70wk81kinqwlnvs9ixb2fzl1z374")))) (build-system cmake-build-system) (arguments '( @@ -553,17 +295,17 @@ "-DSD_AVX=ON" "-DWXWIDGETS_VERSION=3.2.5" (string-append "-DWXWIDGETS_EXTRA_PATH=" (assoc-ref %build-inputs "wxwidgets")) - ) + ) #:substitutable? #f ) ) - (native-inputs (list pkg-config)) - (inputs (list openblas openssl curl exiv2-staticlibs wxwidgets gtk+ pangomm git stable-diffusion-cpp)) - (synopsis "cross-platform GUI for Stable Diffusion C++") - (description "A cross-platform GUI for Stable Diffusion C++, built using wxWidgets.") - (home-page "https://stable-diffusion.fsociety.hu") - (license license:expat) - )) + (native-inputs (list pkg-config)) + (inputs (list openblas openssl curl exiv2-staticlibs wxwidgets gtk+ pangomm git stable-diffusion-cpp)) + (synopsis "cross-platform GUI for Stable Diffusion C++") + (description "A cross-platform GUI for Stable Diffusion C++, built using wxWidgets.") + (home-page "https://stable-diffusion.fsociety.hu") + (license license:expat) + )) (define-public bark-cpp (package @@ -612,7 +354,7 @@ (define-public clip-cpp (package (name "clip-cpp") - (version "f4ee24bb86680a27f83c8e8c70adbcf4cb776615") + (version "348b283cb6c2fc2bde450cc08a05a789dbe109e4") (source (origin (method git-fetch) @@ -623,7 +365,7 @@ (file-name (git-file-name name version)) (sha256 (base32 - "0wybslxzygs1bwdmiy9la0fzids112iiajb3ca6sjkhjp7nwakky")))) + "0xyjnzk8wgx77ip6k9969ljckxmaf165ypbh013hsrvgcrq9knrs")))) (build-system cmake-build-system) ;(inputs (list openblas)) (arguments @@ -708,7 +450,8 @@ #:phases #~(modify-phases %standard-phases (delete 'check) - ))) + ) + )) (inputs (list opencl-clhpp opencl-icd-loader)) (home-page "https://cnugteren.github.io/clblast") (synopsis "Tuned OpenCL BLAS") |