Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -830,32 +830,32 @@ def main():
|
|
830 |
from mycomponent import mycomponent
|
831 |
value = mycomponent(my_input_value="hello there")
|
832 |
st.write("Received", value) # value is speech recognition full text result with \n dividing
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
|
860 |
|
861 |
|
|
|
830 |
from mycomponent import mycomponent
|
831 |
value = mycomponent(my_input_value="hello there")
|
832 |
st.write("Received", value) # value is speech recognition full text result with \n dividing
|
833 |
+
if (len(value))>0:
|
834 |
+
user_input = value
|
835 |
+
if model_choice == "GPT-4o":
|
836 |
+
gpt_response = process_with_gpt(user_input)
|
837 |
+
elif model_choice == "Claude-3":
|
838 |
+
claude_response = process_with_claude(user_input)
|
839 |
+
else: # All Three AIs!
|
840 |
+
col1, col2, col3 = st.columns(3)
|
841 |
+
with col2:
|
842 |
+
st.subheader("Claude-3.5 Sonnet:")
|
843 |
+
try:
|
844 |
+
claude_response = process_with_claude(user_input)
|
845 |
+
except:
|
846 |
+
st.write('Claude 3.5 Sonnet out of tokens.')
|
847 |
+
with col1:
|
848 |
+
st.subheader("GPT-4o Omni:")
|
849 |
+
try:
|
850 |
+
gpt_response = process_with_gpt(user_input)
|
851 |
+
except:
|
852 |
+
st.write('GPT 4o out of tokens')
|
853 |
+
with col3:
|
854 |
+
st.subheader("Arxiv and Mistral Research:")
|
855 |
+
with st.spinner("Searching ArXiv..."):
|
856 |
+
results = perform_ai_lookup(user_input)
|
857 |
+
st.markdown(results)
|
858 |
+
# π################ Component Magic ###############π
|
859 |
|
860 |
|
861 |
|