怎么找到网站后台,搜索引擎优化论文,电脑培训课程,天津网站制作企业whisper#xff1a;https://github.com/openai/whisper/tree/main 参考文章#xff1a;Whisper OpenAI开源语音识别模型 环境配置
pip install faster-whisper transformers准备tiny模型 需要其他版本的可以自己下载#xff1a;https://huggingface.co/openai 原始中文语音… whisperhttps://github.com/openai/whisper/tree/main 参考文章Whisper OpenAI开源语音识别模型 环境配置
pip install faster-whisper transformers准备tiny模型 需要其他版本的可以自己下载https://huggingface.co/openai 原始中文语音模型
https://huggingface.co/openai/whisper-tiny微调后的中文语音模型
git clone https://huggingface.co/xmzhu/whisper-tiny-zh补下一个tokenizer.json
https://huggingface.co/openai/whisper-tiny/resolve/main/tokenizer.json?downloadtrue模型转换
float16
ct2-transformers-converter --model whisper-tiny-zh/ --output_dir whisper-tiny-zh-ct2 --copy_files tokenizer.json preprocessor_config.json --quantization float16int8
ct2-transformers-converter --model whisper-tiny-zh/ --output_dir whisper-tiny-zh-ct2-int8 --copy_files tokenizer.json preprocessor_config.json --quantization int8代码
from faster_whisper import WhisperModel# model_size whisper-tiny-zh-ct2
# model_size whisper-tiny-zh-ct2-int8# Run on GPU with FP16
# model WhisperModel(model_size, devicecuda, compute_typefloat16)
model WhisperModel(model_size, devicecpu, compute_typeint8)# or run on GPU with INT8
# model WhisperModel(model_size, devicecuda, compute_typeint8_float16)
# or run on CPU with INT8
# model WhisperModel(model_size, devicecpu, compute_typeint8)segments, info model.transcribe(output_file.wav, beam_size5, languagezh)print(Detected language %s with probability %f % (info.language, info.language_probability))for segment in segments:print([%.2fs - %.2fs] %s % (segment.start, segment.end, segment.text))