-
Notifications
You must be signed in to change notification settings - Fork 98
/
setup.py
40 lines (36 loc) · 1.16 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import numpy, os, sys
if sys.platform == 'darwin':
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:
os.environ['CFLAGS'] = '-mavx -mavx2 -mfma -mf16c -O3 -std=gnu11'
os.environ['CXXFLAGS'] = '-mavx -mavx2 -mfma -mf16c -O3 -std=c++11'
ext_modules = [
Extension(
name="whispercpp",
sources=["whispercpp.pyx", "whisper.cpp/whisper.cpp"],
language="c++",
extra_compile_args=["-std=c++11"],
)
]
ext_modules = cythonize(ext_modules)
whisper_clib = ('whisper_clib', {'sources': ['whisper.cpp/ggml.c']})
setup(
name='whispercpp',
version='1.0',
description='Python bindings for whisper.cpp',
author='Luke Southam',
author_email='[email protected]',
libraries=[whisper_clib],
ext_modules = cythonize("whispercpp.pyx"),
include_dirs = ['./whisper.cpp/', numpy.get_include()],
install_requires=[
'numpy',
'ffmpeg-python',
'requests'
],
)