Spaces:
Runtime error
Runtime error
Update preprocess/tools/lyric_transcription.py
Browse files
preprocess/tools/lyric_transcription.py
CHANGED
|
@@ -2,7 +2,9 @@
|
|
| 2 |
# https://huggingface.co/nvidia/parakeet-tdt-0.6b-v2
|
| 3 |
import os
|
| 4 |
import re
|
|
|
|
| 5 |
import time
|
|
|
|
| 6 |
from typing import Any, Dict, List, Tuple
|
| 7 |
|
| 8 |
import librosa
|
|
@@ -134,10 +136,13 @@ class _ASREnModel:
|
|
| 134 |
def __init__(self, model_path: str, device: str):
|
| 135 |
try:
|
| 136 |
import nemo.collections.asr as nemo_asr # type: ignore
|
| 137 |
-
except Exception as e:
|
|
|
|
|
|
|
|
|
|
| 138 |
raise ImportError(
|
| 139 |
-
"NeMo (nemo_toolkit) is required for ASR English but
|
| 140 |
-
"
|
| 141 |
) from e
|
| 142 |
|
| 143 |
self.model = nemo_asr.models.ASRModel.restore_from(
|
|
|
|
| 2 |
# https://huggingface.co/nvidia/parakeet-tdt-0.6b-v2
|
| 3 |
import os
|
| 4 |
import re
|
| 5 |
+
import sys
|
| 6 |
import time
|
| 7 |
+
import traceback
|
| 8 |
from typing import Any, Dict, List, Tuple
|
| 9 |
|
| 10 |
import librosa
|
|
|
|
| 136 |
def __init__(self, model_path: str, device: str):
|
| 137 |
try:
|
| 138 |
import nemo.collections.asr as nemo_asr # type: ignore
|
| 139 |
+
except Exception as e:
|
| 140 |
+
# Print the actual error causing the import failure
|
| 141 |
+
print(f"[lyric transcription] Failed to import nemo.collections.asr: {e}", file=sys.stderr)
|
| 142 |
+
traceback.print_exc()
|
| 143 |
raise ImportError(
|
| 144 |
+
"NeMo (nemo_toolkit) is required for ASR English but could not be imported. "
|
| 145 |
+
"See the log above for details."
|
| 146 |
) from e
|
| 147 |
|
| 148 |
self.model = nemo_asr.models.ASRModel.restore_from(
|