majweldon commited on
Commit
383fc57
·
1 Parent(s): e8df9a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -1,14 +1,18 @@
1
 
 
 
 
2
 
3
-
 
4
  from numpy import True_
5
  import gradio as gr
6
- import openai, subprocess
7
- import os
8
  import soundfile as sf
9
  from pydub import AudioSegment
10
 
11
- %cd /content/drive/MyDrive/Colab_Notebooks/
 
 
12
  note_transcript = ""
13
 
14
  def transcribe(audio, history_type):
 
1
 
2
+ import subprocess
3
+ subprocess.run(["pip", "install", "openai"])
4
+ subprocess.run(["pip", "install", "soundfile"])
5
 
6
+ import os
7
+ import openai
8
  from numpy import True_
9
  import gradio as gr
 
 
10
  import soundfile as sf
11
  from pydub import AudioSegment
12
 
13
+ # Load your API key from an environment variable or secret management service
14
+ openai.api_key = os.environ.get('OPENAI_SECRET_KEY')
15
+
16
  note_transcript = ""
17
 
18
  def transcribe(audio, history_type):