AudioSangraha Audio to Text

提供商AqeelShafy7
分类audio-generation
许可证apache-2.0
下载量6
星标0

简介

AudioSangraha 是一款轻量级的语音转文字(ASR)工具,旨在将音频高效地转换为文本。对于中国开发者而言,它提供了一个基于 Apache-2.0 协议的开源方案,非常适合集成到个人项目或企业内部的自动化工作流中。相比于重量级的商业 API,它的上手难度较低,能够快速实现会议记录、播客转写等基础场景。如果你需要一个无需复杂配置且具备良好兼容性的音频处理组件,它可以作为现有文本分析管线的前端输入端,与 LLM 结合实现语音内容的智能化总结。

核心亮点

  • 基于 Apache-2.0 协议,企业级集成无压力
  • 专注语音转文本,适配多种音频转写场景
  • 轻量化部署,上手快且易于集成到工作流
  • 可与大模型结合,实现语音内容的智能分析

使用方法

安装依赖
# 安装 Hugging Face transformers
pip install transformers torch
SDK 使用
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("AqeelShafy7/AudioSangraha-Audio_to_Text")
tokenizer = AutoTokenizer.from_pretrained("AqeelShafy7/AudioSangraha-Audio_to_Text")

Hugging Face 下载

我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。

操作指引:在下载前,请先通过如下命令安装 huggingface_hub:

操作指引
pip install -U huggingface_hub

命令行下载

下载完整模型库

下载完整模型库
huggingface-cli download AqeelShafy7/AudioSangraha-Audio_to_Text

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download AqeelShafy7/AudioSangraha-Audio_to_Text config.json --local-dir ./dir

更多命令行下载选项,可参见官方文档

SDK 下载

SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('AqeelShafy7/AudioSangraha-Audio_to_Text')

Git 下载

请确保 lfs 已经被正确安装

Git 下载
git lfs install
git clone https://huggingface.co/AqeelShafy7/AudioSangraha-Audio_to_Text

如果您希望跳过 lfs 大文件下载,可以使用如下命令

跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/AqeelShafy7/AudioSangraha-Audio_to_Text

模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。

PyTorch / Transformers 使用

安装 Transformers

安装 Transformers
pip install -U transformers torch

模型加载和推理

模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('AqeelShafy7/AudioSangraha-Audio_to_Text')
tokenizer = AutoTokenizer.from_pretrained('AqeelShafy7/AudioSangraha-Audio_to_Text')

完整文档

来源: HuggingFace

---
license: apache-2.0
base_model: openai/whisper-small
tags:

  • trnslation

  • generated_from_trainer

metrics:
  • wer

model-index:
  • name: AudioSangraha-Audio_to_Text

results: []
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

AudioSangraha-Audio_to_Text

This model is a fine-tuned version of openai/whisper-small on the None dataset.
It achieves the following results on the evaluation set:

  • Loss: 0.3071

  • Wer: 52.3227

Model description

More information needed

Intended uses & limitations

More information needed

Training and evaluation data

More information needed

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 1e-05

  • train_batch_size: 8

  • eval_batch_size: 8

  • seed: 42

  • gradient_accumulation_steps: 2

  • total_train_batch_size: 16

  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08

  • lr_scheduler_type: linear

  • lr_scheduler_warmup_steps: 500

  • num_epochs: 10

Training results

| Training Loss | Epoch | Step | Validation Loss | Wer |
|:-------------:|:-----:|:----:|:---------------:|:-------:|
| 0.1036 | 3.91 | 1000 | 0.2257 | 55.1779 |
| 0.007 | 7.81 | 2000 | 0.3071 | 52.3227 |

Framework versions

  • Transformers 4.37.2
  • Pytorch 2.1.0+cu121
  • Datasets 2.17.0
  • Tokenizers 0.15.1