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

The sample can't even run on macos Intel #286

Open
anh-lht opened this issue Sep 2, 2024 · 0 comments
Open

The sample can't even run on macos Intel #286

anh-lht opened this issue Sep 2, 2024 · 0 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@anh-lht
Copy link

anh-lht commented Sep 2, 2024

The sample is not runnable on macOS Intel i9 13th 13900k. I try to print log but can't pass this line
output = model(input)

import torch
import zipfile
import torchaudio
from glob import glob

device = torch.device('cpu')  # gpu also works, but our models are fast enough for CPU
model, decoder, utils = torch.hub.load(repo_or_dir='snakers4/silero-models',
                                       model='silero_stt',
                                       language='en', # also available 'de', 'es'
                                       device=device)
(read_batch, split_into_batches,
 read_audio, prepare_model_input) = utils  # see function signature for details

# download a single file in any format compatible with TorchAudio
torch.hub.download_url_to_file('https://opus-codec.org/static/examples/samples/speech_orig.wav',
                               dst ='speech_orig.wav', progress=True)
test_files = glob('speech_orig.wav')
batches = split_into_batches(test_files, batch_size=10)
input = prepare_model_input(read_batch(batches[0]),
                            device=device)

print("prepare output")
output = model(input)
print("the output is unable to print out.")
for example in output:
    print(decoder(example.cpu()))
@anh-lht anh-lht added the help wanted Extra attention is needed label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants