OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Translator keeps erroring out no idea why

  • Thread starter Thread starter Val
  • Start date Start date
V

Val

Guest
Trying to make a translator using the whisper api

I keep getting this error about numpy being too many versions ahead to be compatibile but I had switch to a version compatibile with Torch Link

Here is the error:

A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.0rc1 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last): File "c:\Users\valro\Desktop\pyton\server\main.py", line 8, in transcription = transAudio(fileName) File "c:\Users\valro\Desktop\pyton\server\record_trans.py", line 42, in transAudio model = whisper.load_model("base") File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\whisper_init_.py", line 146, in load_model checkpoint = torch.load(fp, map_location=device) File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\serialization.py", line 1025, in load return _load(opened_zipfile, File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\serialization.py", line 1446, in _load result = unpickler.load() File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch_utils.py", line 202, in _rebuild_tensor_v2
tensor = _rebuild_tensor(storage, storage_offset, size, stride)
File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch_utils.py", line 180, in _rebuild_tensor t = torch.empty((0,), dtype=storage.dtype, device=storage._untyped_storage.device) C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch_utils.py:180: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:84.) t = torch.empty((0,), dtype=storage.dtype, device=storage.untyped_storage.device) Traceback (most recent call last): File "c:\Users\valro\Desktop\pyton\server\main.py", line 8, in transcription = transAudio(fileName) ^^^^^^^^^^^^^^^^^^^^ File "c:\Users\valro\Desktop\pyton\server\record_trans.py", line 42, in transAudio model = whisper.load_model("base") ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\whisper_init.py", line 154, in load_model model.set_alignment_heads(alignment_heads) File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\whisper\model.py", line 251, in set_alignment_heads
mask = torch.from_numpy(array).reshape(

Checked other forums linked above^ asked chatgpt but it kept circling back saying some dependancies mgiht be clashing, ran a test wiht pip check and pip list --outdated but found nothing useful

Thank you for your time.
<p>Trying to make a translator using the whisper api</p>
<p>I keep getting this error about numpy being too many versions ahead to be compatibile but I had switch to a version compatibile with Torch <a href="https://github.com/pytorch/pytorch/issues/107302" rel="nofollow noreferrer">Link</a></p>
<p>Here is the error:</p>
<p>A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0rc1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.</p>
<p>If you are a user of the module, the easiest solution will be to<br />
downgrade to 'numpy<2' or try to upgrade the affected module.<br />
We expect that some modules will need time to support NumPy 2.</p>
<p>Traceback (most recent call last): File "c:\Users\valro\Desktop\pyton\server\main.py", line 8, in
transcription = transAudio(fileName)
File "c:\Users\valro\Desktop\pyton\server\record_trans.py", line 42, in transAudio
model = whisper.load_model("base")
File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\whisper_<em>init</em>_.py", line 146, in load_model
checkpoint = torch.load(fp, map_location=device)
File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\serialization.py", line 1025, in load
return _load(opened_zipfile,
File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\serialization.py", line 1446, in _load
result = unpickler.load()
File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch_utils.py", line 202, in _rebuild_tensor_v2<br />
tensor = _rebuild_tensor(storage, storage_offset, size, stride)<br />
File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch_utils.py", line 180, in _rebuild_tensor
t = torch.empty((0,), dtype=storage.dtype, device=storage._untyped_storage.device)
C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch_utils.py:180: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:84.)
t = torch.empty((0,), dtype=storage.dtype, device=storage.<em>untyped_storage.device)
Traceback (most recent call last):
File "c:\Users\valro\Desktop\pyton\server\main.py", line 8, in
transcription = transAudio(fileName)
^^^^^^^^^^^^^^^^^^^^
File "c:\Users\valro\Desktop\pyton\server\record_trans.py", line 42, in transAudio
model = whisper.load_model("base")
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\whisper_<em>init</em></em>.py", line 154, in load_model
model.set_alignment_heads(alignment_heads)
File "C:\Users\valro\AppData\Local\Programs\Python\Python312\Lib\site-packages\whisper\model.py", line 251, in set_alignment_heads<br />
mask = torch.from_numpy(array).reshape(</p>
<p>Checked other forums linked above^ asked chatgpt but it kept circling back saying some dependancies mgiht be clashing, ran a test wiht <code>pip check</code> and <code>pip list --outdated</code> but found nothing useful</p>
<p>Thank you for your time.</p>
 

Latest posts

M
Replies
0
Views
1
Muhammad Ikhwan Perwira
M
Top