transcribe : Initial prompt parameter and Text extraction time #439
-
I am combining two questions here and addressing them through the following codes: _**from faster_whisper import WhisperModel Define the initial prompt model_size = "large-v2" Run on GPU with FP16 elapsed_time = time.time() - start_time Initial Prompt Parameter a) I am passing around 3, 500 domain-specific terms as comma-separate text to the initial prompt. It does not work. b) If I pass a few terms it works (for example 'Injection, perineal, Solensia'). How do I pass all these terms as an initial prompt to improve the transcript mistakes? Execution time The above code execution time for 10 mins audio is 7 seconds in GPU - 1 x NVIDIA Tesla V100. Whereas when extracting the text from the segment list object it takes around 40 seconds. How to improve data extraction? Does anyone have a different mechanism to improve the code? Also removing the uh and ums. That code does not take a long time. lstsegments = list(segments) def process_segment(segment): with concurrent.futures.ThreadPoolExecutor() as executor: output_text = ''.join(text for text, _ in results) elapsed_time = time.time() - start_time Please let me know some pointers |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
prompt cannot go beyond 448 tokens https://github.com/guillaumekln/faster-whisper/blob/master/faster_whisper/transcribe.py#L700 |
Beta Was this translation helpful? Give feedback.
-
to remove stop words, use something like |
Beta Was this translation helpful? Give feedback.
-
Read the README again and see the warning about the returned segments being a generator. |
Beta Was this translation helpful? Give feedback.
Read the README again and see the warning about the returned segments being a generator.