Spaces:
Runtime error
Runtime error
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
Browse files
app.py
CHANGED
|
@@ -2,7 +2,10 @@ import gradio as gr
|
|
| 2 |
import time
|
| 3 |
import openai
|
| 4 |
from pathlib import Path
|
|
|
|
| 5 |
|
|
|
|
|
|
|
| 6 |
|
| 7 |
def transcribe(audio, chatbot_history, openai_key):
|
| 8 |
time.sleep(5)
|
|
@@ -17,10 +20,6 @@ def transcribe(audio, chatbot_history, openai_key):
|
|
| 17 |
else:
|
| 18 |
return chatbot_history
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
MAX_WITHOUT_KEY = 5
|
| 23 |
-
|
| 24 |
def openai_stream(history, openai_key, chat_model, use_key):
|
| 25 |
|
| 26 |
if not history or history[-1][1]:
|
|
|
|
| 2 |
import time
|
| 3 |
import openai
|
| 4 |
from pathlib import Path
|
| 5 |
+
import os
|
| 6 |
|
| 7 |
+
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
| 8 |
+
MAX_WITHOUT_KEY = 5
|
| 9 |
|
| 10 |
def transcribe(audio, chatbot_history, openai_key):
|
| 11 |
time.sleep(5)
|
|
|
|
| 20 |
else:
|
| 21 |
return chatbot_history
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
def openai_stream(history, openai_key, chat_model, use_key):
|
| 24 |
|
| 25 |
if not history or history[-1][1]:
|