mirror of
https://github.com/mozilla/DeepSpeech.git
synced 2025-10-26 11:19:39 +00:00
Certain optimisations that TensorFlow recommends cause significant performance penalties in c_speech_features. Explicitly disable these features in the BUILD file only for c_speech_features. The build has been restructured to produce a single deepspeech library, rather than 3 separate deepspeech, c_speech_features and kissfft libaries. This should make the deepspeech client and libraries significantly easier to use and distribute.
37 lines
1.1 KiB
Python
Executable File
37 lines
1.1 KiB
Python
Executable File
#! /usr/bin/env python
|
|
|
|
from setuptools import setup, Extension
|
|
from distutils.command.build import build
|
|
|
|
import os
|
|
import numpy
|
|
import subprocess
|
|
|
|
try:
|
|
numpy_include = numpy.get_include()
|
|
except AttributeError:
|
|
numpy_include = numpy.get_numpy_include()
|
|
|
|
class BuildExtFirst(build):
|
|
sub_commands = [('build_ext', build.has_ext_modules),
|
|
('build_py', build.has_pure_modules),
|
|
('build_clib', build.has_c_libraries),
|
|
('build_scripts', build.has_scripts)]
|
|
|
|
deepspeech = Extension('_deepspeech',
|
|
['python/deepspeech.i'],
|
|
include_dirs = [numpy_include],
|
|
libraries = ['tensorflow', 'deepspeech'])
|
|
|
|
setup(name = 'deepspeech',
|
|
description = 'A library for running inference on a DeepSpeech model',
|
|
author = 'Chris Lord',
|
|
author_email='chrislord.net@gmail.com',
|
|
version = '0.0.1',
|
|
package_dir = {'deepspeech': 'python'},
|
|
packages = [ 'deepspeech' ],
|
|
cmdclass = { 'build': BuildExtFirst },
|
|
license = 'MPL-2.0',
|
|
url = 'https://github.com/mozilla/DeepSpeech',
|
|
ext_modules = [deepspeech])
|