Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,7 @@ from openai import ChatCompletion
|
|
14 |
from xml.etree import ElementTree as ET
|
15 |
from bs4 import BeautifulSoup
|
16 |
from collections import deque
|
|
|
17 |
|
18 |
openai.api_key = os.getenv('OPENAI_KEY')
|
19 |
st.set_page_config(page_title="GPT Streamlit Document Reasoner",layout="wide")
|
@@ -22,6 +23,10 @@ menu = ["txt", "htm", "md", "py"]
|
|
22 |
choice = st.sidebar.selectbox("Output File Type:", menu)
|
23 |
model_choice = st.sidebar.radio("Select Model:", ('gpt-3.5-turbo', 'gpt-3.5-turbo-0301'))
|
24 |
|
|
|
|
|
|
|
|
|
25 |
def transcribe_audio_ui(openai_key):
|
26 |
OPENAI_API_KEY = openai_key
|
27 |
OPENAI_API_URL = "https://api.openai.com/v1/audio/transcriptions"
|
|
|
14 |
from xml.etree import ElementTree as ET
|
15 |
from bs4 import BeautifulSoup
|
16 |
from collections import deque
|
17 |
+
from audio_recorder_streamlit import audio_recorder
|
18 |
|
19 |
openai.api_key = os.getenv('OPENAI_KEY')
|
20 |
st.set_page_config(page_title="GPT Streamlit Document Reasoner",layout="wide")
|
|
|
23 |
choice = st.sidebar.selectbox("Output File Type:", menu)
|
24 |
model_choice = st.sidebar.radio("Select Model:", ('gpt-3.5-turbo', 'gpt-3.5-turbo-0301'))
|
25 |
|
26 |
+
audio_bytes = audio_recorder()
|
27 |
+
if audio_bytes:
|
28 |
+
st.audio(audio_bytes, format="audio/wav")
|
29 |
+
|
30 |
def transcribe_audio_ui(openai_key):
|
31 |
OPENAI_API_KEY = openai_key
|
32 |
OPENAI_API_URL = "https://api.openai.com/v1/audio/transcriptions"
|