Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -99,11 +99,11 @@ def transcribe(audio_path, model_name):
|
|
99 |
pipe = load_pipeline(model_name)
|
100 |
|
101 |
start_time = time.time() # Record the start time
|
102 |
-
print('start record time '
|
103 |
# Load the audio file and calculate its duration
|
104 |
audio = mp.AudioFileClip(audio_path)
|
105 |
audio_duration = audio.duration
|
106 |
-
print(
|
107 |
text = pipe(audio_path, batch_size=BATCH_SIZE, generate_kwargs={"task": "transcribe"}, return_timestamps=True)["text"]
|
108 |
end_time = time.time() # Record the end time
|
109 |
|
@@ -117,7 +117,7 @@ def transcribe(audio_path, model_name):
|
|
117 |
f"Device Used: {'GPU' if torch.cuda.is_available() else 'CPU'}"
|
118 |
)
|
119 |
|
120 |
-
print(
|
121 |
|
122 |
return text, transcription_time_output
|
123 |
|
|
|
99 |
pipe = load_pipeline(model_name)
|
100 |
|
101 |
start_time = time.time() # Record the start time
|
102 |
+
print(str(time.time())+' start record time ')
|
103 |
# Load the audio file and calculate its duration
|
104 |
audio = mp.AudioFileClip(audio_path)
|
105 |
audio_duration = audio.duration
|
106 |
+
print(str(time.time())+' start pipe ')
|
107 |
text = pipe(audio_path, batch_size=BATCH_SIZE, generate_kwargs={"task": "transcribe"}, return_timestamps=True)["text"]
|
108 |
end_time = time.time() # Record the end time
|
109 |
|
|
|
117 |
f"Device Used: {'GPU' if torch.cuda.is_available() else 'CPU'}"
|
118 |
)
|
119 |
|
120 |
+
print(str(time.time())+' return transcribe '+ text )
|
121 |
|
122 |
return text, transcription_time_output
|
123 |
|