Spaces:
Running
on
Zero
Running
on
Zero
Update soni_translate/speech_segmentation.py
Browse files
soni_translate/speech_segmentation.py
CHANGED
@@ -57,7 +57,7 @@ def load_align_and_align_segments(result, audio, DAMHF):
|
|
57 |
# Load alignment model
|
58 |
model_a, metadata = whisperx.load_align_model(
|
59 |
language_code=result["language"],
|
60 |
-
device=os.environ.get("SONITR_DEVICE") if os.environ.get("ZERO_GPU") != "TRUE" else "
|
61 |
model_name=None
|
62 |
if result["language"] in DAMHF.keys()
|
63 |
else EXTRA_ALIGN[result["language"]],
|
@@ -69,7 +69,7 @@ def load_align_and_align_segments(result, audio, DAMHF):
|
|
69 |
model_a,
|
70 |
metadata,
|
71 |
audio,
|
72 |
-
os.environ.get("SONITR_DEVICE") if os.environ.get("ZERO_GPU") != "TRUE" else "
|
73 |
return_char_alignments=True,
|
74 |
print_progress=False,
|
75 |
)
|
|
|
57 |
# Load alignment model
|
58 |
model_a, metadata = whisperx.load_align_model(
|
59 |
language_code=result["language"],
|
60 |
+
device=os.environ.get("SONITR_DEVICE") if os.environ.get("ZERO_GPU") != "TRUE" else "cpu",
|
61 |
model_name=None
|
62 |
if result["language"] in DAMHF.keys()
|
63 |
else EXTRA_ALIGN[result["language"]],
|
|
|
69 |
model_a,
|
70 |
metadata,
|
71 |
audio,
|
72 |
+
os.environ.get("SONITR_DEVICE") if os.environ.get("ZERO_GPU") != "TRUE" else "cpu",
|
73 |
return_char_alignments=True,
|
74 |
print_progress=False,
|
75 |
)
|