台大曾亮軒同學和 NTU COOL 團隊於昨晚(7/17)釋出適合辨識台灣口音中文或是中英交雜音檔的 Cool-Whisper 模型,
Kuwa 透過簡單修改 Modelfile 即可直接套用。
訊息
2024/07/18 12:00 左右該模型因為隱私安全疑慮,暫時下架,
想使用這個模型的朋友可以持續關注該模型的 HuggingFace Hub,
待重新上架即可使用。
建置步驟
- 參考Whisper 建置教學啟動 Whisper executor
- Cool-Whisper 模型大小約為 1.5 GB,執行時最多會佔用約 10 GB 的 VRAM
-
於商店中新建一個名為 Cool-Whisper 的 Bot,基底模型選擇 Whisper,並填入以下模型設定檔,重點是
PARAMETER whisper_model andybi7676/cool-whisper
這個參數SYSTEM "加入標點符號。"
PARAMETER whisper_model andybi7676/cool-whisper #base, large-v1, large-v2, large-v3, medium, small, tiny
PARAMETER whisper_enable_timestamp True #Do not prepend the text a timestamp
PARAMETER whisper_enable_diarization False
PARAMETER whisper_diar_thold_sec 2
PARAMETER whisper_language zh #for auto-detection, set to None, "" or "auto"
PARAMETER whisper_n_threads None #Number of threads to allocate for the inferencedefault to min(4, available hardware_concurrency)
PARAMETER whisper_n_max_text_ctx 16384 #max tokens to use from past text as prompt for the decoder
PARAMETER whisper_offset_ms 0 #start offset in ms
PARAMETER whisper_duration_ms 0 #audio duration to process in ms
PARAMETER whisper_translate False #whether to translate the audio to English
PARAMETER whisper_no_context False #do not use past transcription (if any) as initial prompt for the decoder
PARAMETER whisper_single_segment False #force single segment output (useful for streaming)
PARAMETER whisper_print_special False #print special tokens (e.g. <SOT>, <EOT>, <BEG>, etc.)
PARAMETER whisper_print_progress True #print progress information
PARAMETER whisper_print_realtime False #print results from within whisper.cpp (avoid it, use callback instead)
PARAMETER whisper_print_timestamps True #print timestamps for each text segment when printing realtime
PARAMETER whisper_token_timestamps False #enable token-level timestamps
PARAMETER whisper_thold_pt 0.01 #timestamp token probability threshold (~0.01)
PARAMETER whisper_thold_ptsum 0.01 #timestamp token sum probability threshold (~0.01)
PARAMETER whisper_max_len 0 #max segment length in characters
PARAMETER whisper_split_on_word False #split on word rather than on token (when used with max_len)
PARAMETER whisper_max_tokens 0 #max tokens per segment (0 = no limit)
PARAMETER whisper_speed_up False #speed-up the audio by 2x using Phase Vocoder
PARAMETER whisper_audio_ctx 0 #overwrite the audio context size (0 = use default)
PARAMETER whisper_initial_prompt None #Initial prompt, these are prepended to any existing text context from a previous call
PARAMETER whisper_prompt_tokens None #tokens to provide to the whisper decoder as initial prompt
PARAMETER whisper_prompt_n_tokens 0 #tokens to provide to the whisper decoder as initial prompt
PARAMETER whisper_suppress_blank True #common decoding parameters
PARAMETER whisper_suppress_non_speech_tokens False #common decoding parameters
PARAMETER whisper_temperature 0.0 #initial decoding temperature
PARAMETER whisper_max_initial_ts 1.0 #max_initial_ts
PARAMETER whisper_length_penalty -1.0 #length_penalty
PARAMETER whisper_temperature_inc 0.2 #temperature_inc
PARAMETER whisper_entropy_thold 2.4 #similar to OpenAI's "compression_ratio_threshold"
PARAMETER whisper_logprob_thold -1.0 #logprob_thold
PARAMETER whisper_no_speech_thold 0.6 #no_speech_thold -
即可使用 Cool-Whisper 模型進行語音辨識。下圖為使用 Whisper 與 Cool-Whisper 進行中英夾雜的音檔辨識,可以看到 Cool-Whisper 能正確辨識中英夾雜的情境