awacke1 commited on
Commit
fe0c703
1 Parent(s): b3c04b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -711,11 +711,6 @@ speech_recognition_html = """
711
  }
712
  lastUpdateTime = Date.now();
713
  }
714
-
715
- #window.parent.postMessage({
716
- # type: 'final_transcript',
717
- # text: finalTranscript
718
- #}, '*');
719
 
720
 
721
  output.textContent = fullTranscript + (interimTranscript ? '... ' + interimTranscript : '');
@@ -875,6 +870,11 @@ def get_media_html(media_path, media_type="video", width="100%"):
875
  Your browser does not support the audio element.
876
  </audio>
877
  '''
 
 
 
 
 
878
 
879
  def main():
880
  st.sidebar.markdown("### 🚲BikeAI🏆 Claude and GPT Multi-Agent Research AI")
@@ -893,11 +893,7 @@ def main():
893
 
894
  #Experiment: Use `st.session_state` to store the transcript
895
 
896
- @st.memo
897
- def set_transcript(text):
898
- """Set transcript in session state."""
899
- st.session_state.voice_transcript = text
900
-
901
  # Listen to messages from the HTML component
902
  components.html("""
903
  <script>
 
711
  }
712
  lastUpdateTime = Date.now();
713
  }
 
 
 
 
 
714
 
715
 
716
  output.textContent = fullTranscript + (interimTranscript ? '... ' + interimTranscript : '');
 
870
  Your browser does not support the audio element.
871
  </audio>
872
  '''
873
+
874
+ @st.cache_resource
875
+ def set_transcript(text):
876
+ """Set transcript in session state."""
877
+ st.session_state.voice_transcript = text
878
 
879
  def main():
880
  st.sidebar.markdown("### 🚲BikeAI🏆 Claude and GPT Multi-Agent Research AI")
 
893
 
894
  #Experiment: Use `st.session_state` to store the transcript
895
 
896
+
 
 
 
 
897
  # Listen to messages from the HTML component
898
  components.html("""
899
  <script>