Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Coqui Speech-to-Text #1

Closed
JRMeyer opened this issue Feb 22, 2022 · 18 comments
Closed

Update to Coqui Speech-to-Text #1

JRMeyer opened this issue Feb 22, 2022 · 18 comments

Comments

@JRMeyer
Copy link

JRMeyer commented Feb 22, 2022

Hi there @iamsrp 👋

Very cool project you have here -- Thanks for sharing it with the open-source community!

You might not know, but Coqui STT is the new, actively maintained fork of DeepSpeech. It would be a fairly easy upgrade, and the new Coqui v1.0 model is much more accurate than the old DeepSpeech models 😄

For more context: mozilla/DeepSpeech#3693

@iamsrp
Copy link
Owner

iamsrp commented Feb 25, 2022

Hi Josh,

I tried to have a go with the QuickStart guide in https://stt.readthedocs.io/en/latest/ on an up-to-date Ubuntu box but it fails. Any pointers?

srp

==

$ python3 -m pip install coqui-stt-model-manager
Defaulting to user installation because normal site-packages is not writeable
Collecting coqui-stt-model-manager
  Using cached coqui_stt_model_manager-0.0.19-py3-none-any.whl (599 kB)
Requirement already satisfied: pyxdg==0.27 in /usr/lib/python3/dist-packages (from coqui-stt-model-manager) (0.27)
Requirement already satisfied: requests==2.25.1 in /usr/lib/python3/dist-packages (from coqui-stt-model-manager) (2.25.1)
Collecting coqpit==0.0.9
  Using cached coqpit-0.0.9.tar.gz (16 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting Flask==2.0.1
  Using cached Flask-2.0.1-py3-none-any.whl (94 kB)
Collecting stt==1.1.0
  Using cached stt-1.1.0-cp39-cp39-manylinux_2_24_x86_64.whl (2.6 MB)
Collecting Flask-SocketIO==4.3.2
  Using cached Flask_SocketIO-4.3.2-py2.py3-none-any.whl (15 kB)
Collecting Jinja2==3.0.1
  Using cached Jinja2-3.0.1-py3-none-any.whl (133 kB)
Collecting webrtcvad==2.0.10
  Using cached webrtcvad-2.0.10-cp39-cp39-linux_x86_64.whl
Collecting Flask-Cors==3.0.10
  Using cached Flask_Cors-3.0.10-py2.py3-none-any.whl (14 kB)
Collecting itsdangerous>=2.0
  Using cached itsdangerous-2.1.0-py3-none-any.whl (15 kB)
Collecting Werkzeug>=2.0
  Using cached Werkzeug-2.0.3-py3-none-any.whl (289 kB)
Requirement already satisfied: click>=7.1.2 in /usr/lib/python3/dist-packages (from Flask==2.0.1->coqui-stt-model-manager) (7.1.2)
Requirement already satisfied: Six in /usr/lib/python3/dist-packages (from Flask-Cors==3.0.10->coqui-stt-model-manager) (1.16.0)
Collecting python-socketio<5,>=4.3.0
  Using cached python_socketio-4.6.1-py2.py3-none-any.whl (51 kB)
Collecting MarkupSafe>=2.0
  Using cached MarkupSafe-2.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Collecting numpy<=1.19.4,>=1.19.4
  Using cached numpy-1.19.4-cp39-cp39-manylinux2010_x86_64.whl (14.5 MB)
Collecting python-engineio<4,>=3.13.0
  Using cached python_engineio-3.14.2-py2.py3-none-any.whl (51 kB)
Building wheels for collected packages: coqpit
  Building wheel for coqpit (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for coqpit (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [65 lines of output]
      running bdist_wheel
      running build
      running build_py
      -- Building version 0.0.9
      creating build
      creating build/lib
      creating build/lib/coqpit
      copying coqpit/coqpit.py -> build/lib/coqpit
      copying coqpit/__init__.py -> build/lib/coqpit
      running egg_info
      warning: no files found matching '*.json' under directory 'coqpit'
      warning: no files found matching '*.html' under directory 'coqpit'
      warning: no files found matching '*.png' under directory 'coqpit'
      warning: no files found matching '*.md' under directory 'coqpit'
      warning: no files found matching '*.pyx' under directory 'coqpit'
      warning: no files found matching '*.png' under directory 'images'
      writing manifest file 'coqpit.egg-info/SOURCES.txt'
      running install
      running install_lib
      Traceback (most recent call last):
        File "/home/srp/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/home/srp/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/srp/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 216, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 202, in _build_with_temp_dir
          self.run_setup()
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 145, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 38, in <module>
          setup(
        File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
          return distutils.core.setup(**attrs)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 148, in setup
          dist.run_commands()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 259, in run
          self.run_command('install')
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 61, in run
          return orig.install.run(self)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 578, in run
          self.run_command(cmd_name)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 985, in run_command
          cmd_obj.ensure_finalized()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
          self.finalize_options()
        File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 17, in finalize_options
          self.set_undefined_options('install',('install_layout','install_layout'))
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 290, in set_undefined_options
          setattr(self, dst_option, getattr(src_cmd_obj, src_option))
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 103, in __getattr__
          raise AttributeError(attr)
      AttributeError: install_layout
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for coqpit
Failed to build coqpit
ERROR: Could not build wheels for coqpit, which is required to install pyproject.toml-based projects

@iamsrp
Copy link
Owner

iamsrp commented Feb 26, 2022

Hmm, nevermind. I tried this again and it seems happy now. Likely some form of PEBKAC.

@JRMeyer
Copy link
Author

JRMeyer commented Feb 26, 2022

@iamsrp -- the stt-model-manager is really only for testing out models locally (which can be very helpful), but you're probably just going to need pip install stt

@iamsrp
Copy link
Owner

iamsrp commented Feb 27, 2022

Josh,

I made the changes to use Coqui and it seems to work fine on Ubuntu. However, it fails to pip3 install on Raspberry Pi OS, both directly and via github:

pi@dexter:~ $ pip3 install stt
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: Could not find a version that satisfies the requirement stt
ERROR: No matching distribution found for stt
pi@dexter:~ $ pip3 install git+https://github.com/coqui-ai/STT.git
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting git+https://github.com/coqui-ai/STT.git
  Cloning https://github.com/coqui-ai/STT.git to /tmp/pip-req-build-tsh155kh
  Running command git clone -q https://github.com/coqui-ai/STT.git /tmp/pip-req-build-tsh155kh
  Running command git submodule update --init --recursive -q
Collecting attrdict
  Using cached https://www.piwheels.org/simple/attrdict/attrdict-2.0.1-py2.py3-none-any.whl (9.9 kB)
Requirement already satisfied: bs4 in ./.local/lib/python3.9/site-packages (from coqui-stt-training==1.3.0a3) (0.0.1)
Collecting coqpit
  Using cached https://www.piwheels.org/simple/coqpit/coqpit-0.0.15-py3-none-any.whl (13 kB)
ERROR: Could not find a version that satisfies the requirement coqui_stt_ctcdecoder==1.3.0-alpha.3 (from coqui-stt-training)
ERROR: No matching distribution found for coqui_stt_ctcdecoder==1.3.0-alpha.3
pi@dexter:~ $ 

Are you planning a Pi version at some point? That's pretty much core to Dexter alas...

Thanks,

srp

@JRMeyer
Copy link
Author

JRMeyer commented Feb 27, 2022

Hi @iamsrp -- definitely good for raspberry pi :)

I just realized this isn't in our docs, at STT.readthedocs.io

Thanks for pointing it out!

coqui-ai/STT#2016

@iamsrp
Copy link
Owner

iamsrp commented Feb 27, 2022

Thanks for pointing to that Josh; I hadn't seen you had those prebuilt wheels.

However, I am possibly being dim but it looks like the listed releases are for Python3.7 for ARM? I only see https://github.com/coqui-ai/STT/releases/download/v1.2.0/stt-1.2.0-cp37-cp37m-linux_armv7l.whl in there but:

pi@dexter:~ $ python3 --version
Python 3.9.2
pi@dexter:~ $ 

meaning:

pi@dexter:~ $ pip3 install https://github.com/coqui-ai/STT/releases/download/v1.2.0/stt-1.2.0-cp37-cp37m-linux_armv7l.whl
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: stt-1.2.0-cp37-cp37m-linux_armv7l.whl is not a supported wheel on this platform.

Is this just me missing something obvious?

Cheers,

srp

@JRMeyer
Copy link
Author

JRMeyer commented Feb 27, 2022

Hmmm it looks like we only have the wheel for python 3.7 for raspberry pi... maybe @reuben has more clarity on this?

Is py3.9 a hard requirement for you, @iamsrp ?

@iamsrp
Copy link
Owner

iamsrp commented Feb 27, 2022

Unfortunately it looks like 3.9 is where the world is at these days. It's the default version for Raspberry Pi OS, and Ubuntu, now.

FWIW I also tried to make my own using a fresh checkout but the Makefile looks to only have rules for Docker artifacts. I could also try that route if there are build instructions somewhere.

srp

@JRMeyer
Copy link
Author

JRMeyer commented Feb 27, 2022

We'll be releasing some ARM p3.9 wheels soon:)

coqui-ai/STT#2134

@iamsrp
Copy link
Owner

iamsrp commented Feb 28, 2022

Thanks. That would make me wheely happy.

Ho, as they say, ho. :)

srp

@iamsrp
Copy link
Owner

iamsrp commented Mar 6, 2022

Hi Josh,

I saw there was a new alpha release but couldn't see the Python 3.9 version for arm in it. Do you know when it's scheduled to flow through to the release pages?

Thanks

srp

@reuben
Copy link

reuben commented Mar 7, 2022

The 3.9 builds didn't make it to the release, I ran into some bugs with the Raspbian Bullseye libsox package and with a change in the cross build process between 3.7 and 3.9. So I need to take a look again when I have some time.

@iamsrp
Copy link
Owner

iamsrp commented Mar 9, 2022

Got it, thanks. I'll circle back around at a later date.

Thanks again for taking the time to work on it.

srp

@iamsrp
Copy link
Owner

iamsrp commented Apr 8, 2022

Hi,

Just checking in to see if you had time to take another look at this. I saw there was a new release but didn't see the 3.9 Arm assets in it yet.

Thanks,

srp

@iamsrp
Copy link
Owner

iamsrp commented Jul 3, 2022

Hi Josh,

I had a little go with trying to do the cross-compiling myself this weekend but hit a few roadblocks. (It looks like some of the underlying code in Bazel etc. might have changed of late.)

Just wondering if you guys had any more luck with this.

Thanks, and have a good weekend.

srp

@reuben
Copy link

reuben commented Jul 4, 2022 via email

@iamsrp
Copy link
Owner

iamsrp commented Jul 4, 2022

Thanks for the update Reuben. Good luck with the TF update; they can sometimes be "interesting"..! And I appreciate the efforts.

srp

@iamsrp
Copy link
Owner

iamsrp commented Sep 5, 2022

I just circled back around to this and saw that there was a new release and, with it, the Python 3.9 ARM support! I just tested it and it's all working nicely. Thanks for getting it sorted.

Since we're now on Coqui I am going to close this out but let me know if you think there's anything more pending.

srp

@iamsrp iamsrp closed this as completed Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants