Skip to content

Commit

Permalink
Update Wav2Vec2Process.py-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
arisjr authored Mar 14, 2024
1 parent 9283c74 commit 4ae9cc7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions resources/Wav2Vec2Process.py-alpha
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ def main():

import os
os.environ["OMP_NUM_THREADS"] = "6"
try:
if os.environ["IPED_CUDA_MULTIPLIER"]:
cudaMultiplier = int(os.environ["IPED_CUDA_MULTIPLIER"])
except:
cudaMultiplier = 1


from faster_whisper import WhisperModel

Expand All @@ -31,8 +37,9 @@ def main():
else:
deviceId = 'cpu'

try:
model = WhisperModel(modelName, device=deviceId, device_index=int(deviceNum), compute_type="int8")
try:
from math import floor
model = WhisperModel(modelName, device=deviceId, device_index=floor(int(deviceNum)/cudaMultiplier), compute_type="int8")

except Exception as e:
if deviceId != 'cpu':
Expand Down

0 comments on commit 4ae9cc7

Please sign in to comment.