John Liao commited on
Commit
e8e93a8
·
verified ·
1 Parent(s): 663280b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -1,5 +1,11 @@
1
- import openai
2
- import gradio as gr
 
 
 
 
 
 
3
 
4
  def transcribe(filename,key):
5
  client = openai.OpenAI(api_key = key)
 
1
+ import subprocess
2
+ import sys
3
+
4
+ try:
5
+ import openai
6
+ except ImportError:
7
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "openai"])
8
+ import openai # Import the library after installing it
9
 
10
  def transcribe(filename,key):
11
  client = openai.OpenAI(api_key = key)