Spaces:
Sleeping
Sleeping
John Liao
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,11 @@
|
|
| 1 |
-
import
|
| 2 |
-
import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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)
|