WhisperBot:整合了Mistral大型语言模型的实时语音转文本系统

项目简介

欢迎来到 WhisperBot。WhisperBot 基于 WhisperLive 和 WhisperSpeech 的功能而构建,在实时语音到文本管道之上集成了大型语言模型 Mistral (LLM)。WhisperLive 依赖于 OpenAI Whisper,这是一个强大的自动语音识别 (ASR) 系统。Mistral 和 Whisper 都经过优化,可作为 TensorRT 引擎高效运行,从而最大限度地提高性能和实时处理能力。

特征

  • 实时语音转文本:利用 OpenAI WhisperLive 将口语实时转换为文本。

  • 大型语言模型集成:添加大型语言模型 Mistral,以增强对转录文本的理解和上下文。

  • TensorRT 优化:Mistral 和 Whisper 都经过优化,可作为 TensorRT 引擎运行,确保高性能和低延迟处理。

先决条件

安装 TensorRT-LLM 来构建 Whisper 和 Mistral TensorRT 引擎。自述文件为 TensorRT-LLM 构建了一个 docker 镜像。除了构建 docker 镜像之外,我们还可以参考 README 和 Dockerfile.multi 在基础 pytroch docker 镜像中安装所需的包。只要确保使用 dockerfile 中提到的正确的基础镜像,一切都会顺利进行。

构建 Whisper TensorRT 引擎

构建 Mistral TensorRT 引擎

  • 将工作目录更改为 TensorRT-LLM 文件夹中的 llama 示例目录。

    cd TensorRT-LLM/examples/llama

  • 将 Mistral 转换为 fp16 TensorRT 引擎。

    python build.py --model_dir teknium/OpenHermes-2.5-Mistral-7B \
                    --dtype float16 \
                    --remove_input_padding \
                    --use_gpt_attention_plugin float16 \
                    --enable_context_fmha \
                    --use_gemm_plugin float16 \
                    --output_dir ./tmp/mistral/7B/trt_engines/fp16/1-gpu/ \
                    --max_input_len 5000
                    --max_batch_size 1
    

构建 Phi TensorRT 引擎

注意:Phi 仅在主分支可用,尚未发布。因此,请确保从主分支构建 TensorRT-LLM。

  • 将工作目录更改为 TensorRT-LLM 文件夹中的 phi 示例目录。

    cd TensorRT-LLM/examples/phi

  • 构建 phi TensorRT 引擎

    git lfs install
    git clone https://huggingface.co/microsoft/phi-2
    python3 build.py --dtype=float16
    --log_level=verbose
    --use_gpt_attention_plugin float16
    --use_gemm_plugin float16
    --max_batch_size=16
    --max_input_len=1024
    --max_output_len=1024
    --output_dir=phi_engine
    --model_dir=phi-2>&1 | tee build.log

项目链接

https://github.com/collabora/WhisperBot

相关推荐
梦云澜3 小时前
论文阅读(十二):全基因组关联研究中生物通路的图形建模
论文阅读·人工智能·深度学习
远洋录3 小时前
构建一个数据分析Agent:提升分析效率的实践
人工智能·ai·ai agent
IT古董4 小时前
【深度学习】常见模型-Transformer模型
人工智能·深度学习·transformer
沐雪架构师5 小时前
AI大模型开发原理篇-2:语言模型雏形之词袋模型
人工智能·语言模型·自然语言处理
python算法(魔法师版)6 小时前
深度学习深度解析:从基础到前沿
人工智能·深度学习
kakaZhui6 小时前
【llm对话系统】大模型源码分析之 LLaMA 位置编码 RoPE
人工智能·深度学习·chatgpt·aigc·llama
struggle20257 小时前
一个开源 GenBI AI 本地代理(确保本地数据安全),使数据驱动型团队能够与其数据进行互动,生成文本到 SQL、图表、电子表格、报告和 BI
人工智能·深度学习·目标检测·语言模型·自然语言处理·数据挖掘·集成学习
佛州小李哥7 小时前
通过亚马逊云科技Bedrock打造自定义AI智能体Agent(上)
人工智能·科技·ai·语言模型·云计算·aws·亚马逊云科技
云空8 小时前
《DeepSeek 网页/API 性能异常(DeepSeek Web/API Degraded Performance):网络安全日志》
运维·人工智能·web安全·网络安全·开源·网络攻击模型·安全威胁分析
AIGC大时代8 小时前
对比DeepSeek、ChatGPT和Kimi的学术写作关键词提取能力
论文阅读·人工智能·chatgpt·数据分析·prompt