transiteration
commited on
Commit
•
e39554c
1
Parent(s):
6918317
Update transcribe.py
Browse files- transcribe.py +9 -3
transcribe.py
CHANGED
@@ -4,7 +4,10 @@ from typing import Dict
|
|
4 |
import nemo.collections.asr as nemo_asr
|
5 |
|
6 |
|
7 |
-
def predict_model(
|
|
|
|
|
|
|
8 |
# Restore the ASR model from the provided path
|
9 |
model = nemo_asr.models.ASRModel.restore_from(restore_path=model_path)
|
10 |
# Transcribe the given audio file
|
@@ -16,7 +19,10 @@ if __name__ == "__main__":
|
|
16 |
# Parse command line arguments
|
17 |
parser = argparse.ArgumentParser()
|
18 |
parser.add_argument("--model_path", default=None, help="Path to a model to evaluate.")
|
19 |
-
parser.add_argument("--audio_file_path", help="Path for train manifest JSON file.")
|
20 |
args = parser.parse_args()
|
21 |
|
22 |
-
predict_model(
|
|
|
|
|
|
|
|
4 |
import nemo.collections.asr as nemo_asr
|
5 |
|
6 |
|
7 |
+
def predict_model(
|
8 |
+
model_path: str = None,
|
9 |
+
audio_file_path: str = None,
|
10 |
+
) -> Dict:
|
11 |
# Restore the ASR model from the provided path
|
12 |
model = nemo_asr.models.ASRModel.restore_from(restore_path=model_path)
|
13 |
# Transcribe the given audio file
|
|
|
19 |
# Parse command line arguments
|
20 |
parser = argparse.ArgumentParser()
|
21 |
parser.add_argument("--model_path", default=None, help="Path to a model to evaluate.")
|
22 |
+
parser.add_argument("--audio_file_path", default=None, help="Path for train manifest JSON file.")
|
23 |
args = parser.parse_args()
|
24 |
|
25 |
+
predict_model(
|
26 |
+
model_path=args.model_path,
|
27 |
+
audio_file_path=args.audio_file_path,
|
28 |
+
)
|