deepakkumar07 commited on
Commit
b52239d
·
verified ·
1 Parent(s): c044678

Uploading whisper small tamil model demo app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -1,7 +1,10 @@
1
- from transformers import pipeline
2
  import gradio as gr
 
3
 
4
- pipe = pipeline(task="transcribe", model="deepakkumar07/whisper-small-tamil")
 
 
5
 
6
  def transcribe(audio):
7
  text = pipe(audio)["text"]
 
1
+ import torch
2
  import gradio as gr
3
+ from transformers import pipeline
4
 
5
+ pipe = pipeline(task="automatic-speech-recognition",
6
+ model="deepakkumar07/whisper-small-tamil",
7
+ device="cuda" if torch.cuda.is_available() else "cpu")
8
 
9
  def transcribe(audio):
10
  text = pipe(audio)["text"]