From patchwork Thu Aug 29 04:06:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Tai X-Patchwork-Id: 67387 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9BBBD27BBEA; Thu, 29 Aug 2024 05:08:32 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 884CC27BBE9 for ; Thu, 29 Aug 2024 05:08:30 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sjWS9-0006FR-67; Thu, 29 Aug 2024 00:08:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sjWS7-0006FF-GQ for guix-patches@gnu.org; Thu, 29 Aug 2024 00:08:07 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sjWS7-0004ji-6T for guix-patches@gnu.org; Thu, 29 Aug 2024 00:08:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=FjJC+EvDJcLiXKVhjrA//T+KHWb0XKOynVSHAZl4Z8M=; b=kKi8xpSUE+yx2c7c9EhmOP51lR15fvRIbpaClbMXySsrvKJv1Qpn9g1D1zlxonGySrCiFQYyoe08n9caq7koNd2ZBbaEm5Da0Mqe7S6d4dtCKEpDe+0Axu6gyN0HhE54Blu4OyaxixIbF3RgB7neQo7DZiaJG4QQoEGF8kEMTCiKDGHwtbX/FtD4e6SswFi7sTm7jArUnkTD3YjyPi5mERFUsPv6G9oWwIsjKOWFINi2yGgSpTtEsG/59Cd+XuqTMmb35jidETf47FuwFj4k4Hwf7ppTBNrslj9AOVedfChG+xRdmBxPogPx1rqPpionvTnu/CGJ1sghmLlC3qdJZQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sjWSz-0007hl-Vr for guix-patches@gnu.org; Thu, 29 Aug 2024 00:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72027] [PATCH v7] gnu: Add whisper-cpp. References: <0c08fdb11c2641ece7d267340877c58f144df110.1720587166.git.atai@atai.org> In-Reply-To: <0c08fdb11c2641ece7d267340877c58f144df110.1720587166.git.atai@atai.org> Resent-From: Andy Tai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 29 Aug 2024 04:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72027 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: juli@incana.org, 72027@debbugs.gnu.org Cc: Andy Tai Received: via spool by 72027-submit@debbugs.gnu.org id=B72027.172490453029593 (code B ref 72027); Thu, 29 Aug 2024 04:09:01 +0000 Received: (at 72027) by debbugs.gnu.org; 29 Aug 2024 04:08:50 +0000 Received: from localhost ([127.0.0.1]:50013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sjWSn-0007hE-JT for submit@debbugs.gnu.org; Thu, 29 Aug 2024 00:08:50 -0400 Received: from mail-pl1-f173.google.com ([209.85.214.173]:60458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sjWSk-0007h1-WD for 72027@debbugs.gnu.org; Thu, 29 Aug 2024 00:08:48 -0400 Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-201fbd0d7c2so1935325ad.0 for <72027@debbugs.gnu.org>; Wed, 28 Aug 2024 21:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724904406; x=1725509206; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=FjJC+EvDJcLiXKVhjrA//T+KHWb0XKOynVSHAZl4Z8M=; b=LQLJSr/pWd6WVckezan4bd5ruDJ1QkuhOaLaDgeVGQ2R9fFh75c9hGD0tp/Xb0Rvwl PUw/zYhh2lXJ/Hp+QB8D7eioGJTjUze9rPAbNyoNCGf67D88HhCAMzJiom4O5Y6CGNfz c/zOYOTPtJyeTa3vozov02/GFoE1uiipKX0EcNIEFVZiQWg2KcY8b5MRMJRQRGUO0u0e mwyhK8Mhzx2UF74GGC1GiyScMD7liSuhEaW7ILDiNYXhZr1auNCuDavuqBoQrkPhmqyf zuzqMdzOjl3CTEb6QQmI9ddCnoami0PPZWiUwXjFK71c3zyFq3qEttW3TCKBxSD+DMIl OGBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724904406; x=1725509206; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FjJC+EvDJcLiXKVhjrA//T+KHWb0XKOynVSHAZl4Z8M=; b=gGEWNYJi3KYGecWrR1UZV8hlnoTqk28TlUX2QroS1X62n7jOUqjnH0T2eKS7L7i9mD 8Ube0W13FKAOHbO9rR4EwCLH00m3CIrti1Rn4vGFzuk1nkDMFzpvdO+5mK2q6gfHxOP6 oJdkiE19UCraSyHyHQ2ZEdvVfyFlNSy7PN5znaYFpL649jh13w+TCDVmHcF0gwQPc4uL Bdbkhlmc2R7RshnU7Mi3l7/ptwXkOZ3yAYYwsR2rrDhEhYRBqBs0n8rtO0ec+xkf24VN lwKfuSUJaKBLKcyJmW8QOeWkTshPFOFLoB1O/W4GSy/g9WbiX9BhviNqE6l7FdFVI5HZ JXGQ== X-Forwarded-Encrypted: i=1; AJvYcCUfuHN7nogcp41P/k15lcl2qxD9lHDoh0VZXXqCO84MTzxQ6O/RPWZKQQKH/GaE1djwfaPvKw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzWmdwXSm867b+hLnNqKCph8Ii/R7psEVNk7UoctWncO6Q+I0uA wONK3EHb/I7HepqSAyfg7nvygPYIxJXRg5O1irwVDHSNkx9wqsFO X-Google-Smtp-Source: AGHT+IHWom8yjPwJZ+w+exL9wwzNMoikhiKV2zF4SNYTug4f9u9Ff6FuEx9PELFcu+fa2Fn4YYEbGg== X-Received: by 2002:a17:902:e891:b0:202:3711:6fe9 with SMTP id d9443c01a7336-2050c431613mr17495855ad.51.1724904405742; Wed, 28 Aug 2024 21:06:45 -0700 (PDT) Received: from DEskMiniX300.. ([209.237.158.138]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-205152b14ddsm2472175ad.19.2024.08.28.21.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2024 21:06:45 -0700 (PDT) From: Andy Tai Date: Wed, 28 Aug 2024 21:06:41 -0700 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/machine-learning.scm (whisper-cpp): New variable. Change-Id: If191f434a3f66b16afdc702069eaed1ca22e2427 --- gnu/packages/machine-learning.scm | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) base-commit: de25a21433bf8ac213302c52789af06a37f4f972 diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 4c5b713cbf..bad7033894 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -28,6 +28,7 @@ ;;; Copyright © 2024 Timothee Mathieu ;;; Copyright © 2024 Spencer King ;;; Copyright © 2024 David Elsing +;;; Copyright © 2024 Andy Tai ;;; ;;; This file is part of GNU Guix. ;;; @@ -117,6 +118,7 @@ (define-module (gnu packages machine-learning) #:use-module (gnu packages rdf) #:use-module (gnu packages regex) #:use-module (gnu packages rpc) + #:use-module (gnu packages sdl) #:use-module (gnu packages serialization) #:use-module (gnu packages sphinx) #:use-module (gnu packages statistics) @@ -5937,6 +5939,58 @@ (define-public oneapi-dnnl-for-r-torch (sha256 (base32 "1zyw5rd8x346bb7gac9a7x3saviw3zvp6aqz2z1l9sv163vmjfz6")))))) +(define-public whisper-cpp + (package + (name "whisper-cpp") + (version "1.6.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ggerganov/whisper.cpp") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "01q4j602wkvsf9vw0nsazzgvjppf4fhpy90vqnm9affynyxhi0c4")))) + (build-system cmake-build-system) + (arguments + (list + #:configure-flags #~'("-DWHISPER_STANDALONE=TRUE" "-DWHISPER_SDL2=TRUE") + ;; "-DWHISPER_FFMPEG=TRUE" ; TODO + #:phases #~(modify-phases %standard-phases + #$@(if (not (target-64bit?)) + '((add-after 'unpack 'skip-failing-tests + (lambda _ + ;; 32-bit system + ;; large model does not fit in RAM in 32-bit system, + ;; disable large model test + (substitute* "tests/CMakeLists.txt" + (("LABELS \"large\"") + "DISABLED true"))))) + '())))) + (inputs (list sdl2)) ;ffmpeg openblas ;TODO: + (native-inputs (list pkg-config)) + (properties '((tunable? . #t))) ;use AVX512, FMA, etc. when available + (home-page "https://github.com/ggerganov/whisper.cpp") + (synopsis "OpenAI's Whisper model in C/C++") + (description + "This package is a high-performance inference of OpenAI's +Whisper automatic speech recognition (ASR) model, implemented in plain C/C++ +without dependencies, with +@itemize +@item AVX intrinsics support for x86 architectures +@item VSX intrinsics support for POWER architectures +@item Mixed F16 / F32 precision +@item 4-bit and 5-bit integer quantization support +@item Zero memory allocations at runtime +@item Support for CPU-only inference +@item Efficient GPU support for NVIDIA +@item OpenVINO Support +@item C-style API +@end itemize") + (license license:expat))) + + (define-public python-gguf (package (name "python-gguf")