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

Macos development #143

Open
wants to merge 31 commits into
base: 29-add-option-to-use-speech-to-text-api-rather-than-transcribing-locally
Choose a base branch
from

Conversation

shosseini811
Copy link

Use the Pyaudio library to be able to run on Mac
Screenshot 2023-08-24 at 6 40 05 PM

SevaSk and others added 30 commits May 29, 2023 20:50
…to-text-api-rather-than-transcribing-locally

Added option to use speech to text API rather than transcribing locally
The current project's Python requirement (>=3.0,<4.0) is not compatible with some of the required packages Python requirement:
  - torch requires Python >=3.8.0, so it will not be satisfied for Python >=3.0,<3.8.0
docs(prerequisites): supported python versions
@DawgZter
Copy link

Getting this error

% python main.py --api .../lib/python3.10/site-packages/whisper/timing.py:58: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details. def backtrace(trace: np.ndarray): Traceback (most recent call last): File ".../main.py", line 125, in <module> main() File ".../main.py", line 72, in main root = ctk.CTk() File ".../lib/python3.10/site-packages/customtkinter/windows/ctk_tk.py", line 38, in __init__ tkinter.Tk.__init__(self, **pop_from_dict_by_set(kwargs, self._valid_tk_constructor_arguments)) File ".../lib/python3.10/tkinter/__init__.py", line 2301, in __init__ self._loadtk() File ".../lib/python3.10/tkinter/__init__.py", line 2317, in _loadtk raise RuntimeError("tk.h version (%s) doesn't match libtk.a version (%s)" RuntimeError: tk.h version (8.5) doesn't match libtk.a version (8.6)

@shosseini811
Copy link
Author

I got this solution from ChatGPT. Could you try that?

The error message is signaling a version mismatch between tk.h and libtk.a, which are part of the Tkinter library. This could potentially lead to unexpected behaviors or crashes. Additionally, there's a deprecation warning related to the nopython argument in Numba.

Tkinter Issue:
For resolving the version mismatch, you generally have three routes:

Upgrade tk.h to match libtk.a: If you installed Tkinter through a package manager like apt or yum, upgrading might resolve the issue.
Downgrade libtk.a to match tk.h: Similar to upgrading, you could also downgrade the library.
Environment Isolation: Use a virtual environment that has compatible versions of all packages and libraries.
NumbaDeprecationWarning:
The warning indicates that you are using Numba's @jit decorator without the nopython argument. The warning suggests setting it to True explicitly. This is important for performance, as it ensures the function uses only Numba-compatible types.

Here's how to deal with the Numba warning:

Before:

Screenshot 2023-08-28 at 11 48 58 AM

@shosseini811
Copy link
Author

shosseini811 commented Aug 28, 2023

Here are lists of all libraries I have in conda env. It might help.

pip freeze

aiohttp==3.8.5
aiosignal==1.3.1
async-timeout==4.0.3
attrs==23.1.0
brotlipy==0.7.0
certifi @ file:///private/var/folders/k1/30mswbxs7r1g6zwn8y4fyt500000gp/T/abs_3bweqb8byn/croot/certifi_1690232244779/work/certifi
cffi @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_ab19r4bji3/croot/cffi_1670423206034/work
chardet==5.2.0
charset-normalizer==3.2.0
cryptography @ file:///private/var/folders/k1/30mswbxs7r1g6zwn8y4fyt500000gp/T/abs_a3xvfhudbc/croot/cryptography_1689373681671/work
customtkinter==5.1.3
darkdetect==0.8.0
ffmpeg-python==0.2.0
filelock @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_20tv0lrp8x/croot/filelock_1672387134240/work
frozenlist==1.4.0
future==0.18.3
gmpy2 @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/croot-muov7gw1/gmpy2_1645462616268/work
idna @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_771olrhiqw/croot/idna_1666125579282/work
importlib-metadata==6.8.0
Jinja2 @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_9fjgzv9ant/croot/jinja2_1666908141308/work
llvmlite==0.40.1
MarkupSafe @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_12c133f5-0720-4727-9c18-599a3af825723lzwham3/croots/recipe/markupsafe_1654597866058/work
more-itertools==10.1.0
mpmath @ file:///private/var/folders/k1/30mswbxs7r1g6zwn8y4fyt500000gp/T/abs_17iu6a8a3m/croot/mpmath_1690848269369/work
multidict==6.0.4
networkx @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_b9af3smw_7/croot/networkx_1690562010704/work
numba==0.57.1
numpy @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_f9f5xs2fx0/croot/numpy_and_numpy_base_1682520577456/work
openai==0.27.6
openai-whisper==20230314
Pillow==9.4.0
PyAudio==0.2.13
pycparser @ file:///tmp/build/80754af9/pycparser_1636541352034/work
pyOpenSSL @ file:///private/var/folders/k1/30mswbxs7r1g6zwn8y4fyt500000gp/T/abs_b8whqav6qm/croot/pyopenssl_1690223428943/work
PySocks @ file:///Users/ktietz/Code/oss/ci_pkgs/pysocks_1626781349491/work
regex==2023.8.8
requests @ file:///private/var/folders/k1/30mswbxs7r1g6zwn8y4fyt500000gp/T/abs_54zi68h2nb/croot/requests_1690400233316/work
six==1.16.0
sympy @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_21kpmugwgm/croot/sympy_1668202392692/work
tiktoken==0.3.1
torch==2.0.1
torchaudio==2.0.2
torchvision @ file:///private/var/folders/k1/30mswbxs7r1g6zwn8y4fyt500000gp/T/abs_cfzx6ndngz/croot/torchvision_1689077985227/work
tqdm==4.66.1
typing_extensions @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_1fdywrbp_3/croot/typing_extensions_1690297474455/work
urllib3 @ file:///private/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_e9usuw__8i/croot/urllib3_1686166332689/work
whisper==1.1.10
yarl==1.9.2
zipp==3.16.2

# conda list

Name Version Build Channel

aiohttp 3.8.5 pypi_0 pypi
aiosignal 1.3.1 pypi_0 pypi
async-timeout 4.0.3 pypi_0 pypi
attrs 23.1.0 pypi_0 pypi
blas 2.117 openblas conda-forge
blas-devel 3.9.0 17_osxarm64_openblas conda-forge
brotlipy 0.7.0 py38h1a28f6b_1002
ca-certificates 2023.05.30 hca03da5_0
certifi 2023.7.22 py38hca03da5_0
cffi 1.15.1 py38h80987f9_3
chardet 5.2.0 pypi_0 pypi
charset-normalizer 3.2.0 pypi_0 pypi
cryptography 41.0.2 py38h6204c90_0
customtkinter 5.1.3 pypi_0 pypi
darkdetect 0.8.0 pypi_0 pypi
ffmpeg-python 0.2.0 pypi_0 pypi
filelock 3.9.0 py38hca03da5_0
freetype 2.12.1 h1192e45_0
frozenlist 1.4.0 pypi_0 pypi
future 0.18.3 pypi_0 pypi
giflib 5.2.1 h80987f9_3
gmp 6.2.1 hc377ac9_3
gmpy2 2.1.2 py38h8c48613_0
idna 3.4 py38hca03da5_0
importlib-metadata 6.8.0 pypi_0 pypi
jinja2 3.1.2 py38hca03da5_0
jpeg 9e h80987f9_1
lcms2 2.12 hba8e193_0
lerc 3.0 hc377ac9_0
libblas 3.9.0 17_osxarm64_openblas conda-forge
libcblas 3.9.0 17_osxarm64_openblas conda-forge
libcxx 14.0.6 h848a8c0_0
libdeflate 1.17 h80987f9_0
libffi 3.4.4 hca03da5_0
libgfortran 5.0.0 12_3_0_hd922786_1 conda-forge
libgfortran5 12.3.0 ha3a6a3e_1 conda-forge
liblapack 3.9.0 17_osxarm64_openblas conda-forge
liblapacke 3.9.0 17_osxarm64_openblas conda-forge
libopenblas 0.3.23 openmp_hc731615_0 conda-forge
libpng 1.6.39 h80987f9_0
libtiff 4.5.0 h313beb8_2
libwebp 1.2.4 ha3663a8_1
libwebp-base 1.2.4 h80987f9_1
llvm-openmp 14.0.6 hc6e5704_0
llvmlite 0.40.1 pypi_0 pypi
lz4-c 1.9.4 h313beb8_0
markupsafe 2.1.1 py38h1a28f6b_0
more-itertools 10.1.0 pypi_0 pypi
mpc 1.1.0 h8c48613_1
mpfr 4.0.2 h695f6f0_1
mpmath 1.3.0 py38hca03da5_0
multidict 6.0.4 pypi_0 pypi
ncurses 6.4 h313beb8_0
networkx 3.1 py38hca03da5_0
numba 0.57.1 pypi_0 pypi
numpy 1.24.3 py38h1398885_0
numpy-base 1.24.3 py38h90707a3_0
openai 0.27.6 pypi_0 pypi
openai-whisper 20230314 pypi_0 pypi
openblas 0.3.23 openmp_hf78f355_0 conda-forge
openssl 3.0.10 h1a28f6b_2
pillow 9.4.0 py38h313beb8_0
pip 23.2.1 py38hca03da5_0
pyaudio 0.2.13 pypi_0 pypi
pycparser 2.21 pyhd3eb1b0_0
pyopenssl 23.2.0 py38hca03da5_0
pysocks 1.7.1 py38hca03da5_0
python 3.8.17 hb885b13_0
pytorch 2.0.1 py3.8_0 pytorch
readline 8.2 h1a28f6b_0
regex 2023.8.8 pypi_0 pypi
requests 2.31.0 py38hca03da5_0
setuptools 68.0.0 py38hca03da5_0
six 1.16.0 pypi_0 pypi
sqlite 3.41.2 h80987f9_0
sympy 1.11.1 py38hca03da5_0
tiktoken 0.3.1 pypi_0 pypi
tk 8.6.12 hb8d0fd4_0
torchaudio 2.0.2 py38_cpu pytorch
torchvision 0.15.2 cpu_py38h31aa045_0
tqdm 4.66.1 pypi_0 pypi
typing_extensions 4.7.1 py38hca03da5_0
urllib3 2.0.4 pypi_0 pypi
wheel 0.38.4 py38hca03da5_0
whisper 1.1.10 pypi_0 pypi
xz 5.4.2 h80987f9_0
yarl 1.9.2 pypi_0 pypi
zipp 3.16.2 pypi_0 pypi
zlib 1.2.13 h5a0b063_0
zstd 1.5.5 hd90d995_0

@Don-Yin
Copy link

Don-Yin commented Nov 14, 2023

Hi is there any prospect of merging this to the main branch?

@cnrishiraj
Copy link

Getting this error

[INFO] Adjusting for ambient noise from Default Mic. Please make some noise from the Default Mic...
[INFO] Completed ambient noise adjustment for Default Mic.
[INFO] Adjusting for ambient noise from Default Speaker. Please make or play some noise from the Default Speaker...
[INFO] Completed ambient noise adjustment for Default Speaker.
Traceback (most recent call last):
File "/Users/dd/Downloads/ecoute-main/main.py", line 125, in
main()
File "/Users/dd/Downloads/ecoute-main/main.py", line 85, in main
model = TranscriberModels.get_model('--api' in sys.argv)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dd/Downloads/ecoute-main/TranscriberModels.py", line 10, in get_model
return WhisperTranscriber()
^^^^^^^^^^^^^^^^^^^^
File "/Users/dd/Downloads/ecoute-main/TranscriberModels.py", line 14, in init
self.audio_model = whisper.load_model(os.path.join(os.getcwd(), 'tiny.en.pt'))
^^^^^^^^^^^^^^^^^^
AttributeError: module 'whisper' has no attribute 'load_model'

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

Successfully merging this pull request may close these issues.

None yet

8 participants