webassembly003 whisper.cpp的python绑定实现+Cython+Setuptools

webassembly003 whisper.cpp的python绑定实现+Cython+Setuptools

    正在检查是否收录...

python绑定的相关项目

官方未提供python的封装绑定,直接调用执行文件

https://github.com/stlukey/whispercpp.py提供了源码和Cpython结合的绑定

https://github.com/zhujun1980/whispercpp_py提供了ctype方式的绑定,需要先make libwhisper.so

Pybind11 bindings for Whisper.cpp,有更好的类型安全性和性能

Setuptools 介绍

setuptools 是 Python 中用于构建和分发软件包的工具,它提供了一种简化和标准化的方式来定义和管理项目的元数据、依赖关系以及构建过程。

安装:

pip install setuptools 

示例:setup.py 封装python实现的add 模块:

项目结构如下:
my_package/ |-- my_package/ | |-- __init__.py # NULL | |-- add.py |-- setup.py |-- README.md 
add.py:
# add.py def add(a, b): return a + b 
setup.py:
# setup.py from setuptools import setup, find_packages setup( name="my_package", version="1.0", packages=find_packages(), install_requires=[ # Specify your project dependencies here ], ) 
构建和安装:

在项目根目录下运行以下命令:python setup.py build,python setup.py install

其他构建方式:打tar包/tar包安装,打egg包/egg包安装,打whl包/whl包安装

使用:
from my_package import add result = add.add(3, 4) print(result) # 输出 7 

3. 项目依赖和包管理:

setup.py 中,使用 install_requires 列表来指定项目的依赖关系。当用户安装你的包时,这些依赖关系将会自动安装。

5. 使用 setuptools 扩展:

如果你的项目包含 C 或 C++ 扩展,你可以使用 setuptools.Extension 来指定这些扩展。以下是一个简单的例子:

from setuptools import setup, Extension ext_module = Extension( 'your_module', # 模块名称 sources=['your_module.c'], # 源代码文件 ) setup( name="your_package", version="1.0", ext_modules=[ext_module], ) 

构建 Cython 扩展的方法:

Cython基础

.pxd 文件,.pyx 文件,.pyd 文件

文件类型 描述 .pxd 文件 由 Cython 编程语言编写的 Python 扩展模块头文件。类似于 C 语言的 .h 头文件。包含模块的声明和代码段。可共享外部 C 语言声明,也能包含 C 编译器内联函数。为 .pyx 文件提供接口,以便其他 Cython 模块可以使用更高效的协议与之通信。可使用 cimport 关键字将 .pxd 文件导入 .pyx 模块文件中。 .pyx 文件 由 Cython 编程语言编写的 Python 扩展模块源代码文件。类似于 C 语言的 .c 源代码文件。包含模块的源代码。必须先编译成 .c 文件,再编译成 .pyd(Windows)或 .so(Linux)文件,方可导入和使用。 .pyd 文件 由非 Python 编程语言编写并编译生成的 Python 扩展模块。在 Python 中使用时,通过 import 语句导入。实际上,在 .pyd 文件中封装了一个模块。Cython 可以将个人基于 Python 的模块编译成具有 C 语言特性的 .pyd 文件。

常见的 Cython 数据类型:

1. 基本整数类型:

int:标准整数类型。 long:长整数类型。 bint:布尔类型。
cdef int a = 42 cdef long b = 1234567890123456789 cdef bint flag = True 

2. 浮点数类型:

float:标准浮点数类型。 double:双精度浮点数类型。
cdef float x = 3.14 cdef double y = 2.71828 

3. 数组和缓冲区类型:

list:Python 列表。 tuple:Python 元组。 array:Cython 提供的数组类型。
cdef list py_list = [1, 2, 3] cdef tuple py_tuple = (4, 5, 6) cdef int[:] cython_array = array([7, 8, 9]) 

4. 字符串类型:

str:Python 字符串类型。 bytes:字节类型。
cdef str py_string = "Hello" cdef bytes cython_bytes = b"World" 
bytes

在 CPython(即官方的 Python 解释器)中,bytes 对象是不可变的序列,用于存储二进制数据。它与 bytearray 对象的主要区别在于,bytes 对象是不可变的,而 bytearray 对象是可变的。

以下是关于 bytes 对象的一些基本信息:

不可变性:bytes 对象是不可变的,这意味着一旦创建,其内容不能被修改。你不能像列表一样通过索引赋值来改变 bytes 对象中的某个元素。

字节表示:bytes 对象包含一系列字节,每个字节的值范围在 0 到 255 之间。字节以整数表示,并可以使用 b'...' 语法来创建 bytes 字面值。

# 创建bytes对象 b = b'Hello, World!' 

字节序列的操作:bytes 支持与字节序列相关的许多操作,例如索引、切片、长度计算等。

# 使用索引获取字节值 print(b[0]) # 输出 72 (ASCII码中 'H' 的值) # 使用切片获取部分字节序列 print(b[7:]) # 输出 b'World!' # 计算字节序列的长度 print(len(b)) # 输出 13 

不可变性的好处:bytes 对象的不可变性使得它适用于表示一些固定不变的二进制数据,例如文件内容、网络数据等。此外,由于不可变性,bytes 对象可以作为字典的键,而 bytearray 对象不能。

# 不可变性允许bytes对象作为字典键 data_dict = {b'key': 'value'} 

内置方法:bytes 类型提供了一些内置方法,如 decode() 用于将字节解码为字符串,hex() 用于获取字节的十六进制表示。

# 解码为字符串 string_representation = b.decode('utf-8') # 获取十六进制表示 hex_representation = b.hex() 
这将创建一个 Python 字节字符串对象,该对象包含 原始 C 字符串。它可以在 Python 代码中安全地传递,并且 将在对它的最后一个引用结束时进行垃圾回收 范围。重要的是要记住,字符串中的 null 字节会起作用 作为终止符字符,通常从 C 中知道。以上将 因此,仅适用于不包含 null 的 C 字符串 字节。

5. 其他类型:

object:Python 对象类型,通常用于处理任意类型的对象。 memoryview:内存视图类型,用于处理内存缓冲区。 pointer:指针类型,用于与 C 语言中的指针进行交互。
cdef object generic_object = some_function() cdef memoryview buffer_view = memoryview(some_buffer) cdef int* ptr = <int*>some_pointer 

6. 并行迭代类型:

prange:并行迭代类型,用于在循环中实现并行迭代。
from cython.parallel import prange cdef int i for i in prange(10): # 在此进行并行迭代的操作 

这些类型提供了在 Cython 中进行类型声明和优化的灵活性。选择适当的类型取决于你的算法和数据的特性,以及在 Cython 中进行性能优化的目标。

Cpython的强制类型转换

在 Cython 中,与 C 类型相关的强制类型转换通常是通过 C 的类型声明和类型转换函数来实现的。以下是一些常见的 Cython 中的类型转换示例:

1. C 的类型声明

在 Cython 中,可以使用 C 的类型声明来明确变量的类型。例如,对于整数、浮点数和字符类型:

cdef int x = 42 cdef double y = 3.14 cdef char c = 'A' 

2. Python 对象到 C 类型的转换

使用 (<C类型>) 语法将 Python 对象强制转换为 C 类型。例如,将 Python 中的整数对象转换为 C 中的整数:

cdef int py_int = 42 cdef int c_int = <int>py_int 

3. C 类型到 Python 对象的转换

使用 (<Python类型>) 语法将 C 类型强制转换为 Python 对象。例如,将 C 中的整数转换为 Python 中的整数对象:

cdef int c_int = 42 cdef object py_int = <object>c_int 

4. 使用 cast() 函数

Cython 还提供了 cast() 函数,用于进行更复杂的类型转换。这对于在不同的 C 类型之间进行转换非常有用:

from cython cimport cast cdef int c_int = 42 cdef double c_double = cast(double, c_int) 

5. 使用 numpy 中的类型转换

如果涉及到 NumPy 数组,可以使用 numpy 模块提供的一些函数进行类型转换:

import numpy as np cimport numpy as np cdef np.ndarray[np.int32_t, ndim=1] int_array = np.array([1, 2, 3], dtype=np.int32) cdef np.ndarray[np.float64_t, ndim=1] float_array = int_array.astype(np.float64) 

这些是 Cython 中一些常见的类型转换方法。根据具体的应用场景,你可能需要使用不同的方式进行类型转换。在进行类型转换时,请确保转换是安全的,以避免潜在的错误和问题。

cythonize和pyx

cythonize 是 Cython 提供的一个用于编译 Cython 源文件的命令。它将 Cython 源文件(.pyx)转换为 C 代码,然后编译为共享库(.so 文件或相应平台的文件)。如果使用了 Cython 编写 C 扩展,可以使用 setuptools 配合 Cython.Build.cythonize 来构建,然后,可以使用以下命令构建并安装:python setup.py build_ext --inplace

基本用法:

setup.py 文件中使用 cythonize 来构建和编译 Cython 源文件。通常,cythonize 接受一个包含 .pyx 文件路径的列表,然后返回一个用于设置的 Extension 对象列表。

# setup.py from setuptools import setup from Cython.Build import cythonize setup( ext_modules=cythonize("your_module.pyx"), # ext_modules=cythonize(["module1.pyx", "module2.pyx"]), # 处理多个文件: # ext_modules=cythonize("your_module.pyx", compiler_directives={'boundscheck': False}), # 额外的编译选项 ) 
使用 annotate 生成 HTML 文件:

annotate 选项用于生成包含注释的 HTML 文件,以便查看 C 代码中哪些部分是由 Cython 自动生成的。这有助于理解性能瓶颈和进行调试。

# setup.py from setuptools import setup from Cython.Build import cythonize setup( ext_modules=cythonize("your_module.pyx", annotate=True), ) 

Cython+setup.py 封装add 模块

正确编译的.so文件在python当中就是module
cython(.pyx, .pxi)-> c/c++ -> so

项目结构:

my_package/ |-- add/ | |-- add.c | |-- add.h |-- my_package/ | |-- __init__.py | |-- add_wrapper.pyx |-- setup.py |-- README.md 

代码

// add.c int add(int a, int b) { return a + b; } 
// add.h int add(int a, int b); 
# add_wrapper.pyx cdef extern from "add.h": int add(int a, int b) def add_py(int a, int b): return add(a, b) 
# setup.py from setuptools import setup, Extension from Cython.Build import cythonize # Extension module ext_module = Extension( "my_package.add_wrapper", # Python模块名称 sources=[ "my_package/add_wrapper.pyx", # Cython源文件 "add/add.c", # C源文件 ], include_dirs=["add/"], # 包含的头文件目录 ) setup( name="my_package", version="1.0", packages=["my_package"], ext_modules=cythonize([ext_module]), zip_safe=False, ) 

构建和安装:

python setup.py build_ext --inplace 
from my_package import add_wrapper result = add_wrapper.add_py(3, 4) print(result) # 输出 7 

whispercpp.py的setup.py内容

# 从distutils和Cython导入必要的模块 from distutils.core import setup from distutils.extension import Extension from Cython.Build import cythonize # 导入用于平台检测的额外模块 import numpy, os, sys # 根据平台检测设置相应的环境变量 if sys.platform == 'darwin': # macOS os.environ['CFLAGS'] = '-DGGML_USE_ACCELERATE -O3 -std=gnu11' os.environ['CXXFLAGS'] = '-DGGML_USE_ACCELERATE -O3 -std=c++11' os.environ['LDFLAGS'] = '-framework Accelerate' else: # 其他平台(假定为类Linux) os.environ['CFLAGS'] = '-mavx -mavx2 -mfma -mf16c -O3 -std=gnu11' os.environ['CXXFLAGS'] = '-mavx -mavx2 -mfma -mf16c -O3 -std=c++11' # 定义Cython扩展模块 ext_modules = [ Extension( name="whispercpp", sources=["whispercpp.pyx", "whisper.cpp/whisper.cpp"], language="c++", extra_compile_args=["-std=c++11"], ) ] # 使用cythonize函数编译Cython扩展模块 ext_modules = cythonize(ext_modules) # 定义whisper.cpp的C库 whisper_clib = ('whisper_clib', {'sources': ['whisper.cpp/ggml.c']}) # 使用setup函数配置Python包 setup( name='whispercpp', version='1.0', description='whisper.cpp的Python绑定', author='Luke Southam', author_email='luke@devthe.com', libraries=[whisper_clib], # 指定C库 ext_modules=cythonize("whispercpp.pyx"), # 包含Cython扩展模块 include_dirs=['./whisper.cpp/', numpy.get_include()], # 编译时包含的目录 install_requires=[ 'numpy', 'ffmpeg-python', 'requests' ], # 指定依赖项 ) 

whispercpp.pxd

cdef nogil:# 使用 'nogil' 语句告诉Cython编译器在以下代码段中不需要GIL (Global Interpreter Lock),多线程并行 int WHISPER_SAMPLE_RATE = 16000 # 采样率 int WHISPER_N_FFT = 400 # FFT点数 int WHISPER_N_MEL = 80 # 梅尔滤波器数量 int WHISPER_HOP_LENGTH = 160 # 帧移 int WHISPER_CHUNK_SIZE = 30 # 音频块大小 int SAMPLE_RATE = 16000 # 采样率 char* TEST_FILE = b'test.wav' # 测试文件名 char* DEFAULT_MODEL = b'ggml-tiny.bin' # 默认模型文件名 char* LANGUAGE = b'fr' # 语言 # 定义一个C语言结构体,用于存储音频数据的相关信息。 ctypedef struct audio_data: float* frames; # 指向浮点数数组的指针,存储音频帧 int n_frames; # 音频帧的数量 
cdef extern from "whisper.h" nogil:# 使用 'extern from' 语句声明与外部C语言头文件 "whisper.h" 相关的一些元素 # 定义枚举类型 whisper_sampling_strategy enum whisper_sampling_strategy: WHISPER_SAMPLING_GREEDY = 0, WHISPER_SAMPLING_BEAM_SEARCH, ctypedef bint _Bool # 定义一个函数指针类型 whisper_new_segment_callback,该函数用于接收新的语音片段的回调。 ctypedef void (*whisper_new_segment_callback)(whisper_context*, int, void*) # 定义一个函数指针类型 whisper_encoder_begin_callback,该函数用于编码器开始的回调。 ctypedef _Bool whisper_encoder_begin_callback(whisper_context*, void*) ctypedef int whisper_token # 定义结构体 whisper_token_data ctypedef struct whisper_token_data: whisper_token id whisper_token tid float p float pt float ptsum int64_t t0 int64_t t1 float vlen 

whispercpp.pyx

# 导入需要的模块和类型 cimport numpy as cnp import ffmpeg import numpy as np # 声明 load_audio 函数,接受一个字节数组 file 和一个可选的采样率参数 sr cdef cnp.ndarray[cnp.float32_t, ndim=1, mode="c"] load_audio(bytes file, int sr = SAMPLE_RATE): try: # 使用 ffmpeg 库读取音频文件 out = ( ffmpeg.input(file, threads=0) .output( "-", format="s16le", acodec="pcm_s16le", ac=1, ar=sr ) .run( cmd=["ffmpeg", "-nostdin"], capture_stdout=True, capture_stderr=True ) )[0] except: # 处理异常,如果文件不存在则抛出 RuntimeError raise RuntimeError(f"File '{file}' not found") # 将二进制音频数据转换为 NumPy 数组 cdef cnp.ndarray[cnp.float32_t, ndim=1, mode="c"] frames = ( np.frombuffer(out, np.int16) # 将二进制数据解析为 int16 的 NumPy 数组 .flatten() # 展平数组 .astype(np.float32) # 转换元素类型为 float32 ) / pow(2, 15) # 归一化到 [-1, 1] 范围 # 返回处理后的音频数据 return frames 
def transcribe(self, filename=TEST_FILE): # 打印加载数据的提示信息 print("Loading data..") # 检查传入的文件名是否是NumPy数组 if (type(filename) == np.ndarray): temp = filename # 如果传入的是字符串文件名,使用load_audio函数加载音频数据 elif (type(filename) == str): temp = load_audio(<bytes>filename) # 如果没有提供文件名,使用默认的TEST_FILE else: temp = load_audio(<bytes>TEST_FILE) # 将加载的音频数据转换为Cython的NumPy数组类型 # 声明一个一维的 NumPy 数组 frames,元素类型为 float32,使用 "c"(连续存储)模式 cdef cnp.ndarray[cnp.float32_t, ndim=1, mode="c"] frames = temp # 打印转录的提示信息 print("Transcribing..") # 调用Cython扩展中的whisper_full函数进行音频转录,传递上下文、参数和音频数据的指针 return whisper_full(self.ctx, self.params, &frames[0], len(frames)) 
 def extract_text(self, int res): print("Extracting text...") if res != 0: raise RuntimeError cdef int n_segments = whisper_full_n_segments(self.ctx) return [ whisper_full_get_segment_text(self.ctx, i).decode() for i in range(n_segments) ] 

test.py

克隆源码并简单修改

# git clone --recurse-submodules https://github.com/stlukey/whispercpp.py.git cdef class Whisper: cdef whisper_context * ctx cdef whisper_full_params params def __init__(self, model=DEFAULT_MODEL,model_path= None ,pb=None, buf=None): model_fullname = f'ggml-{model}.bin' download_model(model_fullname) if model_path==None: model_path= Path(MODELS_DIR).joinpath(model_fullname) cdef bytes model_b = str(model_path).encode('utf8') if buf is not None: self.ctx = whisper_init_from_buffer(buf, buf.size) else: self.ctx = whisper_init_from_file(model_b) self.params = default_params() whisper_print_system_info() 

安装依赖与环境

$ pip install numpy $ python setup.py build $ python setup.py install /home/pdd/anaconda3/envs/mwi/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !! ******************************************************************************** Please avoid running ``setup.py`` directly. Instead, use pypa/build, pypa/installer or other standards-based tools. See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details. ******************************************************************************** !! self.initialize_options() /home/pdd/anaconda3/envs/mwi/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated. !! ******************************************************************************** Please avoid running ``setup.py`` and ``easy_install``. Instead, use pypa/build, pypa/installer or other standards-based tools. See https://github.com/pypa/setuptools/issues/917 for details. ******************************************************************************** !! self.initialize_options() zip_safe flag not set; analyzing archive contents... __pycache__.whispercpp.cpython-310: module references __file__ /home/pdd/anaconda3/envs/mwi/lib/python3.10/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg` !! ******************************************************************************** The license_file parameter is deprecated, use license_files instead. This deprecation is overdue, please update your project and remove deprecated calls to avoid build errors in the future. See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details. ******************************************************************************** !! parsed = self.parsers.get(option_name, lambda x: x)(value) warning: no files found matching '*.au' under directory 'tests' warning: no files found matching '*.gif' under directory 'tests' warning: no files found matching '*.txt' under directory 'tests' /home/pdd/anaconda3/envs/mwi/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !! ******************************************************************************** Please avoid running ``setup.py`` directly. Instead, use pypa/build, pypa/installer or other standards-based tools. See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details. ******************************************************************************** !! self.initialize_options() zip_safe flag not set; analyzing archive contents... future.backports.test.__pycache__.ssl_servers.cpython-310: module references __file__ future.backports.test.__pycache__.support.cpython-310: module references __file__ future.standard_library.__pycache__.__init__.cpython-310: module references __file__ future.standard_library.__pycache__.__init__.cpython-310: module references __path__ future.utils.__pycache__.__init__.cpython-310: module MAY be using inspect.stack past.builtins.__pycache__.misc.cpython-310: module MAY be using inspect.stack past.translation.__pycache__.__init__.cpython-310: module references __file__ past.translation.__pycache__.__init__.cpython-310: module references __path__ Adding future 0.18.3 to easy-install.pth file detected new path './charset_normalizer-3.3.2-py3.10-linux-x86_64.egg' Installing futurize script to /home/pdd/anaconda3/envs/mwi/bin Installing pasteurize script to /home/pdd/anaconda3/envs/mwi/bin Installed /home/pdd/anaconda3/envs/mwi/lib/python3.10/site-packages/future-0.18.3-py3.10.egg Searching for numpy==1.26.3 Best match: numpy 1.26.3 Adding numpy 1.26.3 to easy-install.pth file detected new path './future-0.18.3-py3.10.egg' Installing f2py script to /home/pdd/anaconda3/envs/mwi/bin Using /home/pdd/anaconda3/envs/mwi/lib/python3.10/site-packages Finished processing dependencies for whispercpp==1.0 

测试代码

from whispercpp import Whisper w = Whisper('large',model_path= "/home/pdd/myassets/ggml-medium.bin") result = w.transcribe("/home/pdd/le/pywhisper/output.wav") # result = w.transcribe("myfile.mp3") text = w.extract_text(result) print(text) 

CG

whispercpp.pyx:107:54: Storing unsafe C derivative of temporary Python reference

Python 的 .py 与 Cython 的 .pxd .pyx .pyd 文件格式之间的主要区别

pip install git+https://github.com/stlukey/whispercpp.py

$ pip install git+https://github.com/stlukey/whispercpp.py Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com Collecting git+https://github.com/stlukey/whispercpp.py Cloning https://github.com/stlukey/whispercpp.py to /tmp/pip-req-build-a3w_pl8y Running command git clone --filter=blob:none --quiet https://github.com/stlukey/whispercpp.py /tmp/pip-req-build-a3w_pl8y Resolved https://github.com/stlukey/whispercpp.py to commit 7af678159c29edb3bc2a51a72665073d58f2352f Running command git submodule update --init --recursive -q Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting numpy (from whispercpp==1.0) Downloading numpy-1.26.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 kB 455.1 kB/s eta 0:00:00 Collecting ffmpeg-python (from whispercpp==1.0) Downloading ffmpeg_python-0.2.0-py3-none-any.whl (25 kB) Collecting requests (from whispercpp==1.0) Downloading requests-2.31.0-py3-none-any.whl.metadata (4.6 kB) Collecting future (from ffmpeg-python->whispercpp==1.0) Downloading future-0.18.3.tar.gz (840 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 840.9/840.9 kB 766.4 kB/s eta 0:00:00 Preparing metadata (setup.py) ... done Collecting charset-normalizer<4,>=2 (from requests->whispercpp==1.0) Downloading charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (33 kB) Collecting idna<4,>=2.5 (from requests->whispercpp==1.0) Downloading idna-3.6-py3-none-any.whl.metadata (9.9 kB) Collecting urllib3<3,>=1.21.1 (from requests->whispercpp==1.0) Downloading urllib3-2.1.0-py3-none-any.whl.metadata (6.4 kB) Collecting certifi>=2017.4.17 (from requests->whispercpp==1.0) Downloading certifi-2023.11.17-py3-none-any.whl.metadata (2.2 kB) Downloading numpy-1.26.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.2/18.2 MB 1.2 MB/s eta 0:00:00 Downloading requests-2.31.0-py3-none-any.whl (62 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 kB 1.3 MB/s eta 0:00:00 Downloading certifi-2023.11.17-py3-none-any.whl (162 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 162.5/162.5 kB 1.2 MB/s eta 0:00:00 Downloading charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 142.1/142.1 kB 1.2 MB/s eta 0:00:00 Downloading idna-3.6-py3-none-any.whl (61 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.6/61.6 kB 1.4 MB/s eta 0:00:00 Downloading urllib3-2.1.0-py3-none-any.whl (104 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 104.6/104.6 kB 1.1 MB/s eta 0:00:00 Building wheels for collected packages: whispercpp, future Building wheel for whispercpp (pyproject.toml) ... done Created wheel for whispercpp: filename=whispercpp-1.0-cp310-cp310-linux_x86_64.whl size=282976 sha256=4d3d98884e99b8b884435550b64ef03f5b47bac9348b90c75b45f350fb24f82c Stored in directory: /tmp/pip-ephem-wheel-cache-k94yja86/wheels/66/a1/a8/e5b342b3d6d1b65b787546ee9d5a1d948c8ab3db3c879d7df1 Building wheel for future (setup.py) ... done Created wheel for future: filename=future-0.18.3-py3-none-any.whl size=492024 sha256=672e398dc922fcc5cc49da626a356ed3c27f184cc2811e11438c9e51d0a7f60d Stored in directory: /tmp/pip-ephem-wheel-cache-k94yja86/wheels/5e/a9/47/f118e66afd12240e4662752cc22cefae5d97275623aa8ef57d Successfully built whispercpp future Installing collected packages: urllib3, numpy, idna, future, charset-normalizer, certifi, requests, ffmpeg-python, whispercpp Successfully installed certifi-2023.11.17 charset-normalizer-3.3.2 ffmpeg-python-0.2.0 future-0.18.3 idna-3.6 numpy-1.26.3 requests-2.31.0 urllib3-2.1.0 whispercpp-1.0 
https://github.com/Topping1/whispercppGUI/blob/main/whisperGUI.py

whisperpythonnumpygitlinuxgithubcoderapappctourltokenhtmlscriptgui编程语言clihive数据转换代码段
  • 本文作者:WAP站长网
  • 本文链接: https://wapzz.net/post-8552.html
  • 版权声明:本博客所有文章除特别声明外,均默认采用 CC BY-NC-SA 4.0 许可协议。
本站部分内容来源于网络转载,仅供学习交流使用。如涉及版权问题,请及时联系我们,我们将第一时间处理。
文章很赞!支持一下吧 还没有人为TA充电
为TA充电
还没有人为TA充电
0
0
  • 支付宝打赏
    支付宝扫一扫
  • 微信打赏
    微信扫一扫
感谢支持
文章很赞!支持一下吧
关于作者
2.8W+
9
1
2
WAP站长官方

一种推荐系统中的排序学习的原创算法:斯奇拉姆排序

上一篇

开源的Gemma 模型:Google 的语言奇迹,让你用指令调优、低秩适应和 Switch Transformer 玩转小模型

下一篇
  • 复制图片
按住ctrl可打开默认菜单