awacke1 commited on
Commit
a4ace8b
Β·
verified Β·
1 Parent(s): d4495f4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -5
app.py CHANGED
@@ -72,11 +72,6 @@ headers = {
72
  }
73
 
74
 
75
- # Component Magic
76
- mycomponent = components.declare_component("mycomponent", path="mycomponent") # load from __init__.py and index.html in mycomponent folder
77
- from mycomponent import mycomponent
78
- value = mycomponent(my_input_value="hello there")
79
- st.write("Received", value)
80
 
81
  # 2.🚲BikeAIπŸ† Initialize session states
82
  if 'transcript_history' not in st.session_state:
@@ -825,6 +820,44 @@ def main():
825
  tab_main = st.radio("Choose Action:",
826
  ["🎀 Voice Input", "πŸ“Έ Media Gallery", "πŸ” Search ArXiv", "πŸ“ File Editor"],
827
  horizontal=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
828
 
829
  if tab_main == "🎀 Voice Input":
830
  st.subheader("Voice Recognition")
 
72
  }
73
 
74
 
 
 
 
 
 
75
 
76
  # 2.🚲BikeAIπŸ† Initialize session states
77
  if 'transcript_history' not in st.session_state:
 
820
  tab_main = st.radio("Choose Action:",
821
  ["🎀 Voice Input", "πŸ“Έ Media Gallery", "πŸ” Search ArXiv", "πŸ“ File Editor"],
822
  horizontal=True)
823
+
824
+
825
+ # πŸ†################ Component Magic ###############πŸ†
826
+ mycomponent = components.declare_component("mycomponent", path="mycomponent") # load from __init__.py and index.html in mycomponent folder
827
+ from mycomponent import mycomponent
828
+ value = mycomponent(my_input_value="hello there")
829
+ st.write("Received", value) # value is speech recognition full text result with \n dividing
830
+
831
+ user_input = value
832
+ if model_choice == "GPT-4o":
833
+ gpt_response = process_with_gpt(user_input)
834
+ elif model_choice == "Claude-3":
835
+ claude_response = process_with_claude(user_input)
836
+ else: # Both
837
+ col1, col2, col3 = st.columns(3)
838
+ with col2:
839
+ st.subheader("Claude-3.5 Sonnet:")
840
+ try:
841
+ claude_response = process_with_claude(user_input)
842
+ except:
843
+ st.write('Claude 3.5 Sonnet out of tokens.')
844
+ with col1:
845
+ st.subheader("GPT-4o Omni:")
846
+ try:
847
+ gpt_response = process_with_gpt(user_input)
848
+ except:
849
+ st.write('GPT 4o out of tokens')
850
+ with col3:
851
+ st.subheader("Arxiv and Mistral Research:")
852
+ with st.spinner("Searching ArXiv..."):
853
+ #results = search_arxiv(user_input)
854
+ results = perform_ai_lookup(user_input)
855
+
856
+ st.markdown(results)
857
+ # πŸ†################ Component Magic ###############πŸ†
858
+
859
+
860
+
861
 
862
  if tab_main == "🎀 Voice Input":
863
  st.subheader("Voice Recognition")