devilent2 commited on
Commit
2fa7bce
1 Parent(s): 58cafdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 '+str(time.time()))
103
  # Load the audio file and calculate its duration
104
  audio = mp.AudioFileClip(audio_path)
105
  audio_duration = audio.duration
106
- print('start pipe '+str(time.time()))
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('return transcribe '+str(time.time()))
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