Skip to content

Commit

Permalink
add time logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kurianbenoy committed Feb 22, 2024
1 parent f5ccf9e commit 03e9a16
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def generate_seamlessm4t_speech(item: Dict):
"""
# import wave
import os
from datetime import time
import time

import torch
import torchaudio
Expand Down Expand Up @@ -162,7 +162,7 @@ def generate_seamlessm4t_speech(item: Dict):
)
print(speech_timestamps_seconds)
# translator = download_models()
start = time.time()
start = time.perf_counter()
model_name = "seamlessM4T_v2_large"
vocoder_name = "vocoder_v2" if model_name == "seamlessM4T_v2_large" else "vocoder_36langs"

Expand All @@ -173,7 +173,8 @@ def generate_seamlessm4t_speech(item: Dict):
dtype=torch.float16,
)

print(f"Time taken is: {time.time() - start}")
duration = time.perf_counter() - start
print(f"Duration is: {duration}")

# duration = get_duration_wave(fname)
# print(f"Duration: {duration:.2f} seconds")
Expand Down

0 comments on commit 03e9a16

Please sign in to comment.