Skip to content

Commit

Permalink
'#1823: use float16, not int8, for better precision and ~50% more speed
Browse files Browse the repository at this point in the history
  • Loading branch information
lfcnassif committed Apr 15, 2024
1 parent cc7b495 commit b6ec69d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions iped-app/resources/scripts/tasks/WhisperProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ def main():
deviceNum = 0

try:
model = WhisperModel(modelName, device=deviceId, device_index=deviceNum, cpu_threads=threads, compute_type="int8")
model = WhisperModel(modelName, device=deviceId, device_index=deviceNum, cpu_threads=threads, compute_type="float16")

except Exception as e:
if deviceId != 'cpu':
# loading on GPU failed (OOM?), try on CPU
deviceId = 'cpu'
model = WhisperModel(model_size_or_path=modelName, device=deviceId, cpu_threads=threads, compute_type="int8")
model = WhisperModel(model_size_or_path=modelName, device=deviceId, cpu_threads=threads, compute_type="float16")
else:
raise e

Expand Down

0 comments on commit b6ec69d

Please sign in to comment.