Spaces:
Build error
Build error
Commit
·
5d61ee6
1
Parent(s):
a98c1b4
Update app.py
Browse files
app.py
CHANGED
@@ -112,15 +112,7 @@ def get_table_download_link(file_path):
|
|
112 |
return href
|
113 |
|
114 |
|
115 |
-
|
116 |
-
filename = save_and_play_audio(audio_recorder)
|
117 |
-
if filename is not None:
|
118 |
-
transcription = transcribe_audio(openai.api_key, filename, "whisper-1")
|
119 |
-
st.write(transcription)
|
120 |
-
gptOutput = chat_with_model(transcription, '') # push transcript through as prompt
|
121 |
-
filename = generate_filename(transcription, choice)
|
122 |
-
create_file(filename, transcription, gptOutput)
|
123 |
-
st.sidebar.markdown(get_table_download_link(filename), unsafe_allow_html=True)
|
124 |
|
125 |
def CompressXML(xml_text):
|
126 |
root = ET.fromstring(xml_text)
|
@@ -157,6 +149,15 @@ def main():
|
|
157 |
if api_key:
|
158 |
openai.api_key = api_key
|
159 |
from audio_recorder_streamlit import audio_recorder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
|
161 |
uploaded_file = st.sidebar.file_uploader("Add a file for context:", type=["xml", "json", "xlsx","csv","html", "htm", "md", "txt"])
|
162 |
max_length = st.sidebar.slider("File section length for large files", min_value=1000, max_value=128000, value=12000, step=1000)
|
|
|
112 |
return href
|
113 |
|
114 |
|
115 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
def CompressXML(xml_text):
|
118 |
root = ET.fromstring(xml_text)
|
|
|
149 |
if api_key:
|
150 |
openai.api_key = api_key
|
151 |
from audio_recorder_streamlit import audio_recorder
|
152 |
+
# Audio, transcribe, GPT:
|
153 |
+
filename = save_and_play_audio(audio_recorder)
|
154 |
+
if filename is not None:
|
155 |
+
transcription = transcribe_audio(openai.api_key, filename, "whisper-1")
|
156 |
+
st.write(transcription)
|
157 |
+
gptOutput = chat_with_model(transcription, '') # push transcript through as prompt
|
158 |
+
filename = generate_filename(transcription, choice)
|
159 |
+
create_file(filename, transcription, gptOutput)
|
160 |
+
st.sidebar.markdown(get_table_download_link(filename), unsafe_allow_html=True)
|
161 |
|
162 |
uploaded_file = st.sidebar.file_uploader("Add a file for context:", type=["xml", "json", "xlsx","csv","html", "htm", "md", "txt"])
|
163 |
max_length = st.sidebar.slider("File section length for large files", min_value=1000, max_value=128000, value=12000, step=1000)
|