Spaces:
Running
Running
Update app.py
Browse files
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")
|