Ridealist commited on
Commit
e7b338c
1 Parent(s): f1783c6

refactor: rename whisper app by modulizing

Browse files
whisper_app.py → modules/whisper_modules.py RENAMED
@@ -1,5 +1,3 @@
1
- import whisper
2
- import gradio as gr
3
  from dotenv import dotenv_values
4
  import openai
5
  import os
@@ -17,7 +15,7 @@ config = dotenv_values(".env")
17
  openai.organization = config.get('OPENAI_ORGANIZATION')
18
  openai.api_key = config.get('OPENAI_API_KEY')
19
 
20
- def debate(audio):
21
  os.rename(audio, audio + '.wav')
22
  file = open(audio + '.wav', "rb")
23
 
@@ -73,12 +71,13 @@ def transcribe(audio):
73
 
74
  return result
75
 
76
- gr.Interface(
77
- title = 'Whisper Audio to Text with Speaker Recognition',
78
- fn=debate,
79
- inputs=[
80
- gr.inputs.Audio(source="microphone", type="filepath"),
81
- #gr.inputs.Number(default=2, label="Number of Speakers")
82
- ],
83
- outputs="text"
84
- ).launch()
 
 
 
 
1
  from dotenv import dotenv_values
2
  import openai
3
  import os
 
15
  openai.organization = config.get('OPENAI_ORGANIZATION')
16
  openai.api_key = config.get('OPENAI_API_KEY')
17
 
18
+ def debate_in_sound(audio):
19
  os.rename(audio, audio + '.wav')
20
  file = open(audio + '.wav', "rb")
21
 
 
71
 
72
  return result
73
 
74
+
75
+ # gr.Interface(
76
+ # title = 'Whisper Audio to Text with Speaker Recognition',
77
+ # fn=debate,
78
+ # inputs=[
79
+ # gr.inputs.Audio(source="microphone", type="filepath"),
80
+ # #gr.inputs.Number(default=2, label="Number of Speakers")
81
+ # ],
82
+ # outputs="text"
83
+ # ).launch()
whisper_app.sh DELETED
@@ -1 +0,0 @@
1
- python whisper_app.py