Skip to content

Commit

Permalink
3.7 + Pytorch 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
experimenti committed Sep 23, 2018
1 parent 94d6ad2 commit 1d28415
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
python-levenshtein
torch
visdom
wget
librosa
tqdm
tqdm

# Compiling Pytorch
8 changes: 7 additions & 1 deletion transcribe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
import warnings
import sys

from opts import add_decoder_args, add_inference_args

Expand All @@ -16,7 +17,7 @@

parser = argparse.ArgumentParser(description='DeepSpeech transcription')
parser = add_inference_args(parser)
parser.add_argument('--audio-path', default='audio.wav',
parser.add_argument('--audio-path', default=None,
help='Audio file to predict on')
parser.add_argument('--offsets', dest='offsets', action='store_true', help='Returns time offset information')
parser = add_decoder_args(parser)
Expand Down Expand Up @@ -65,6 +66,11 @@ def transcribe(audio_path, parser, model, decoder, cuda=False):

if __name__ == '__main__':
torch.set_grad_enabled(False)

if args.audio_path is None:
print("Error: Path to audio file is required: --audio-path" )
sys.exit(1)

model = DeepSpeech.load_model(args.model_path)
if args.cuda:
model.cuda()
Expand Down

0 comments on commit 1d28415

Please sign in to comment.