Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -49,8 +49,10 @@ def generate_filename(prompt, file_type):
|
|
49 |
|
50 |
def transcribe_audio(openai_key, file_path, model):
|
51 |
OPENAI_API_URL = "https://api.openai.com/v1/audio/transcriptions"
|
|
|
|
|
52 |
headers = {
|
53 |
-
"Authorization": f"Bearer {
|
54 |
}
|
55 |
with open(file_path, 'rb') as f:
|
56 |
data = {'file': f}
|
|
|
49 |
|
50 |
def transcribe_audio(openai_key, file_path, model):
|
51 |
OPENAI_API_URL = "https://api.openai.com/v1/audio/transcriptions"
|
52 |
+
key = os.getenv('OPENAI_KEY')
|
53 |
+
|
54 |
headers = {
|
55 |
+
"Authorization": f"Bearer {key}",
|
56 |
}
|
57 |
with open(file_path, 'rb') as f:
|
58 |
data = {'file': f}
|