khalidey commited on
Commit
57970f1
1 Parent(s): 9417b92

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -5,20 +5,16 @@ pipe1 = pipeline(model="khalidey/ID2223_Lab2_Whisper_SV") # change to "your-use
5
  pipe2 = pipeline('text-generation', model='birgermoell/swedish-gpt')
6
 
7
  def transcribe(audio):
8
- text = pipe1(audio)["text"]
9
- return text
10
-
11
- def generateText(audio):
12
  text = pipe1(audio)["text"]
13
  generated_text = pipe2(text, max_length = 30, num_return_sequences=2)[0]['generated_text']
14
  return text, generated_text
15
 
16
  iface = gr.Interface(
17
- fn=generateText,
18
  inputs=gr.Audio(source="microphone", type="filepath"),
19
  outputs=['text', 'text'],
20
- title="Whisper Small Swedish",
21
- description="Realtime demo for Swedish speech recognition using a fine-tuned Whisper small model.",
22
  )
23
 
24
  iface.launch()
 
5
  pipe2 = pipeline('text-generation', model='birgermoell/swedish-gpt')
6
 
7
  def transcribe(audio):
 
 
 
 
8
  text = pipe1(audio)["text"]
9
  generated_text = pipe2(text, max_length = 30, num_return_sequences=2)[0]['generated_text']
10
  return text, generated_text
11
 
12
  iface = gr.Interface(
13
+ fn=transcribe,
14
  inputs=gr.Audio(source="microphone", type="filepath"),
15
  outputs=['text', 'text'],
16
+ title="Whisper Small Swedish + Swedish GPT",
17
+ description="Realtime demo for Swedish speech recognition using a fine-tuned Whisper small model and text generation with Swedish GPT.",
18
  )
19
 
20
  iface.launch()