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

Unable to run faster-whisper in tests #645

Closed
ruliworst opened this issue Jan 16, 2024 · 6 comments
Closed

Unable to run faster-whisper in tests #645

ruliworst opened this issue Jan 16, 2024 · 6 comments

Comments

@ruliworst
Copy link

Hi,

I am trying to run a transcription in a test (pytest) but an error is raised:

Error while running tests:
TypeError: Cannot read properties of null (reading 'testsuites')

The line when the test crashes is (line 629, /faster-whisper/transcribe.py):

        return self.model.encode(features, to_cpu=to_cpu)

Any help is appreciated. Thanks in advance.

@trungkienbkhn
Copy link
Collaborator

Hello. It seems that your problem is not a bug from faster whisper. I found the same error occurring with VS code:
microsoft/vscode-python#21176
microsoft/vscode-python#14107
Can you run faster-whisper without pytest? Or can you show your pytest code ?

@ruliworst
Copy link
Author

ruliworst commented Jan 18, 2024

Hi,

Can you run faster-whisper without pytest? // Yes, I can.

Or can you show your pytest code ? // Sure.

import faster_whisper as fw

def test():
  model = fw.WhisperModel(
     model_size_or_path = "C:/Downloads/faster-base",
     local_files_only = True,
     device = "auto")

  model.transcribe("C:/Downloads/audio.wav")

It fails in model.transcribe line.

@Purfview
Copy link
Contributor

import faster_whisper as fw

@trungkienbkhn
Copy link
Collaborator

Hi. Your test is quite simple and I think it has no logic errors (except for changing fs => fw). In addition, you can refer to the transcribe tests in this project:
https://github.com/SYSTRAN/faster-whisper/blob/master/tests/test_transcribe.py

@ruliworst
Copy link
Author

import faster_whisper as fw

Yes sorry, that was an error copying the code.

Hi. Your test is quite simple and I think it has no logic errors (except for changing fs => fw). In addition, you can refer to the transcribe tests in this project: https://github.com/SYSTRAN/faster-whisper/blob/master/tests/test_transcribe.py

Thank you very much, I'll check it.

@ruliworst
Copy link
Author

Hi again, the problem was in device parameter. If it is set to 'auto' for some reason the GPU is not detected but, if I set device to 'cpu' it runs properly. Thanks a lot guys.

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