From e146c59a5e91b08419562f8c7fddf49d6863632d Mon Sep 17 00:00:00 2001 From: jiatastic Date: Fri, 21 Jul 2023 00:35:43 -0400 Subject: [PATCH] light theme --- .streamlit/config.toml | 2 +- aws/synthesize_speech.py | 6 ------ pages/Resume Screen.py | 3 --- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.streamlit/config.toml b/.streamlit/config.toml index 2f641ce..c502896 100644 --- a/.streamlit/config.toml +++ b/.streamlit/config.toml @@ -1,4 +1,4 @@ [theme] -base = 'dark' +#base = 'dark' primaryColor = 'F63366' font = 'sans serif' \ No newline at end of file diff --git a/aws/synthesize_speech.py b/aws/synthesize_speech.py index 777b643..6a7a2d8 100644 --- a/aws/synthesize_speech.py +++ b/aws/synthesize_speech.py @@ -13,14 +13,11 @@ ) def synthesize_speech(text): - Polly = Session.client("polly") - response = Polly.synthesize_speech( Text=text, OutputFormat="mp3", VoiceId="Joanna") - if "AudioStream" in response: # Note: Closing the stream is important because the service throttles on the # number of parallel connections. Here we are using contextlib.closing to @@ -37,12 +34,10 @@ def synthesize_speech(text): # Could not write to file, exit gracefully print(error) sys.exit(-1) - else: # The response didn't contain audio data, exit gracefully print("Could not stream audio") sys.exit(-1) - ''' # Play the audio using the platform's default player if sys.platform == "win32": @@ -51,5 +46,4 @@ def synthesize_speech(text): # The following works on macOS and Linux. (Darwin = mac, xdg-open = linux). opener = "open" if sys.platform == "darwin" else "xdg-open" subprocess.call([opener, output])''' - return output \ No newline at end of file diff --git a/pages/Resume Screen.py b/pages/Resume Screen.py index b648308..39dd045 100644 --- a/pages/Resume Screen.py +++ b/pages/Resume Screen.py @@ -136,17 +136,14 @@ def answer_call_back(): llm_answer = st.session_state.resume_screen.run(input) # speech synthesis and speak out audio_file_path = synthesize_speech(llm_answer) - st.session_state.audio_file_path = audio_file_path # create audio widget with autoplay audio_widget = Audio(audio_file_path, autoplay=True) - # save audio data to history st.session_state.resume_history.append( Message("ai", llm_answer) ) st.session_state.token_count += cb.total_tokens - return audio_widget except: st.session_state.resume_history.append(Message("ai", "Sorry, I didn't get that. Please try again."))