awacke1 commited on
Commit
f587b49
Β·
verified Β·
1 Parent(s): 46b95bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -26
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
- 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
 
 
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