MeBai commited on
Commit
a7f4fc5
·
verified ·
1 Parent(s): 5c5c018

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
2
  from transformers import WhisperProcessor, WhisperForConditionalGeneration
3
  from datasets import load_dataset
4
  import torch
 
5
 
6
  # 加载 Whisper 模型和 processor
7
  model_name = "openai/whisper-large-v3-turbo"
@@ -31,7 +32,7 @@ def transcribe(audio_path):
31
  # Gradio 界面
32
  iface = gr.Interface(
33
  fn=transcribe,
34
- inputs=gr.Audio( type="filepath"),
35
  outputs="text",
36
  title="Whisper Transcription for Developers",
37
  description="使用 Whisper 和 bigcode 数据集转录开发者相关术语。"
 
2
  from transformers import WhisperProcessor, WhisperForConditionalGeneration
3
  from datasets import load_dataset
4
  import torch
5
+ import librosa
6
 
7
  # 加载 Whisper 模型和 processor
8
  model_name = "openai/whisper-large-v3-turbo"
 
32
  # Gradio 界面
33
  iface = gr.Interface(
34
  fn=transcribe,
35
+ inputs=gr.Audio( type="filepath"),
36
  outputs="text",
37
  title="Whisper Transcription for Developers",
38
  description="使用 Whisper 和 bigcode 数据集转录开发者相关术语。"