jsbeaudry commited on
Commit
bfbc50c
·
verified ·
1 Parent(s): 90c138d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -4
app.py CHANGED
@@ -1,16 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from transformers import pipeline
2
  import gradio as gr
3
 
4
- pipe = pipeline(model="jsbeaudry/jsbeaudry/kreyol-tts")
 
5
 
6
  def transcribe(audio):
7
- text = pipe(audio)["text"]
 
8
  return text
9
 
10
-
11
  iface = gr.Interface(
12
  fn=transcribe,
13
- inputs=gr.Audio(type="filepath"),
14
  outputs="text",
15
  title="Whisper medium Creole",
16
  description="Realtime demo for Haitian Creole speech recognition using a fine-tuned medium small model.",
 
1
+ # from transformers import pipeline
2
+ # import gradio as gr
3
+
4
+ # pipe = pipeline(model="jsbeaudry/jsbeaudry/kreyol-tts")
5
+
6
+ # def transcribe(audio):
7
+ # text = pipe(audio)["text"]
8
+ # return text
9
+
10
+
11
+ # iface = gr.Interface(
12
+ # fn=transcribe,
13
+ # inputs=gr.Audio(type="filepath"),
14
+ # outputs="text",
15
+ # title="Whisper medium Creole",
16
+ # description="Realtime demo for Haitian Creole speech recognition using a fine-tuned medium small model.",
17
+ # )
18
+
19
+ # iface.launch()
20
+
21
+
22
+
23
  from transformers import pipeline
24
  import gradio as gr
25
 
26
+ # Reuse the previously created pipeline object
27
+ pipe = pipeline(model="jsbeaudry/creole-speech-to-text")
28
 
29
  def transcribe(audio):
30
+ # Use the 'whisper' pipeline defined in the previous cell
31
+ text = whisper(audio)["text"]
32
  return text
33
 
 
34
  iface = gr.Interface(
35
  fn=transcribe,
36
+ inputs=gr.Audio(type="filepath"),
37
  outputs="text",
38
  title="Whisper medium Creole",
39
  description="Realtime demo for Haitian Creole speech recognition using a fine-tuned medium small model.",