Redve commited on
Commit
c0d5772
·
1 Parent(s): c0d245c

removed gitignore

Browse files
Files changed (1) hide show
  1. app.py +23 -3
app.py CHANGED
@@ -1,18 +1,38 @@
1
  from transformers import pipeline
2
  import gradio as gr
 
 
3
 
4
  pipe = pipeline(model="Redve/BengaliModel")
5
 
6
  def transcribe(audio):
7
  text = pipe(audio)["text"]
 
8
  return text
9
 
10
- iface = gr.Interface(
 
 
 
 
 
 
 
 
11
  fn=transcribe,
12
- inputs=gr.Audio(source="microphone", type="filepath"),
13
  outputs="text",
14
  title="Whisper Small Bengali",
15
  description="Realtime demo for Bengali speech recognition using a fine-tuned Whisper small model.",
16
  )
17
 
18
- iface.launch()
 
 
 
 
 
 
 
 
 
 
1
  from transformers import pipeline
2
  import gradio as gr
3
+ import pytube as pt
4
+ import os
5
 
6
  pipe = pipeline(model="Redve/BengaliModel")
7
 
8
  def transcribe(audio):
9
  text = pipe(audio)["text"]
10
+ print(text)
11
  return text
12
 
13
+ # def video(url):
14
+ # video = pt.YouTube(url)
15
+ # out_path = video.streams.filter(only_audio=True).first().download()
16
+ # name = os.path.splitext(out_path)[0]
17
+ # mp3_path = name + '.mp3'
18
+ # text = pipe(mp3_path)["text"]
19
+ # return text
20
+
21
+ audio= gr.Interface(
22
  fn=transcribe,
23
+ inputs=gr.Audio(sources=["microphone"]),
24
  outputs="text",
25
  title="Whisper Small Bengali",
26
  description="Realtime demo for Bengali speech recognition using a fine-tuned Whisper small model.",
27
  )
28
 
29
+ # video = gr.Interface(
30
+ # fn=video,
31
+ # inputs="text",
32
+ # outputs="text",
33
+ # title="Whisper Small Bengali",
34
+ # description="Realtime demo for Bengali speech recognition using a fine-tuned Whisper small model.",
35
+ # )
36
+
37
+ audio.launch()
38
+ # video.launch()