Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -886,80 +886,12 @@ def main():
|
|
886 |
if transcript is not None and transcript != "":
|
887 |
st.session_state.voice_transcript = transcript
|
888 |
|
889 |
-
# Display the transcript in a Streamlit text area
|
890 |
-
#st.markdown("### Processed Voice Input:")
|
891 |
-
#st.text_area("Voice Transcript", st.session_state.voice_transcript, height=100)
|
892 |
-
|
893 |
-
# Add functionality to process the transcript
|
894 |
-
#if st.button("Process Transcript"):
|
895 |
-
# st.subheader("AI Response to Transcript")
|
896 |
-
# gpt_response = process_with_gpt(st.session_state.voice_transcript)
|
897 |
-
# st.markdown(gpt_response)
|
898 |
-
|
899 |
-
# Option to clear the transcript
|
900 |
-
#if st.button("Clear Transcript"):
|
901 |
-
# st.session_state.voice_transcript = ""
|
902 |
-
# st.rerun()
|
903 |
-
|
904 |
-
|
905 |
-
# Buttons to process the transcript
|
906 |
-
#if st.button("Search with GPT"):
|
907 |
-
# st.subheader("GPT-4o Response")
|
908 |
-
# gpt_response = process_with_gpt(st.session_state.voice_transcript)
|
909 |
-
# st.markdown(gpt_response)
|
910 |
-
|
911 |
-
#if st.button("Search with Claude"):
|
912 |
-
# st.subheader("Claude Response")
|
913 |
-
# claude_response = process_with_claude(st.session_state.voice_transcript)
|
914 |
-
# st.markdown(claude_response)
|
915 |
-
|
916 |
-
#if st.button("Search ArXiv"):
|
917 |
-
# st.subheader("ArXiv Search Results")
|
918 |
-
# arxiv_results = perform_ai_lookup(st.session_state.voice_transcript)
|
919 |
-
# st.markdown(arxiv_results)
|
920 |
-
|
921 |
-
|
922 |
-
# Display last voice input
|
923 |
-
#if st.session_state.last_voice_input:
|
924 |
-
# st.text_area("Last Voice Input:", st.session_state.last_voice_input, height=100)
|
925 |
-
|
926 |
|
927 |
# Model Selection
|
928 |
model_choice = st.sidebar.radio(
|
929 |
"Choose AI Model:",
|
930 |
["GPT+Claude+Arxiv", "GPT-4o", "Claude-3"]
|
931 |
)
|
932 |
-
|
933 |
-
# Chat Interface
|
934 |
-
user_input = st.text_area("Message:", height=100)
|
935 |
-
|
936 |
-
if st.button("Send ๐จ"):
|
937 |
-
if user_input:
|
938 |
-
if model_choice == "GPT-4o":
|
939 |
-
gpt_response = process_with_gpt(user_input)
|
940 |
-
elif model_choice == "Claude-3":
|
941 |
-
claude_response = process_with_claude(user_input)
|
942 |
-
else: # Both
|
943 |
-
col1, col2, col3 = st.columns(3)
|
944 |
-
with col2:
|
945 |
-
st.subheader("Claude-3.5 Sonnet:")
|
946 |
-
try:
|
947 |
-
claude_response = process_with_claude(user_input)
|
948 |
-
except:
|
949 |
-
st.write('Claude 3.5 Sonnet out of tokens.')
|
950 |
-
with col1:
|
951 |
-
st.subheader("GPT-4o Omni:")
|
952 |
-
try:
|
953 |
-
gpt_response = process_with_gpt(user_input)
|
954 |
-
except:
|
955 |
-
st.write('GPT 4o out of tokens')
|
956 |
-
with col3:
|
957 |
-
st.subheader("Arxiv and Mistral Research:")
|
958 |
-
with st.spinner("Searching ArXiv..."):
|
959 |
-
#results = search_arxiv(user_input)
|
960 |
-
results = perform_ai_lookup(user_input)
|
961 |
-
|
962 |
-
st.markdown(results)
|
963 |
|
964 |
# Display Chat History
|
965 |
st.subheader("Chat History ๐")
|
@@ -976,14 +908,6 @@ def main():
|
|
976 |
with st.chat_message(message["role"]):
|
977 |
st.markdown(message["content"])
|
978 |
|
979 |
-
# ------------------------------------------------------- ************************* --->
|
980 |
-
|
981 |
-
#if tab_main == "๐ฌ Chat":
|
982 |
-
# Model Selection
|
983 |
-
#model_choice = st.sidebar.radio(
|
984 |
-
# "Choose AI Model:",
|
985 |
-
# ["GPT-4o", "Claude-3", "GPT+Claude+Arxiv"]
|
986 |
-
#)
|
987 |
|
988 |
# Chat Interface
|
989 |
user_input = st.text_area("Message:", height=100)
|
|
|
886 |
if transcript is not None and transcript != "":
|
887 |
st.session_state.voice_transcript = transcript
|
888 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
889 |
|
890 |
# Model Selection
|
891 |
model_choice = st.sidebar.radio(
|
892 |
"Choose AI Model:",
|
893 |
["GPT+Claude+Arxiv", "GPT-4o", "Claude-3"]
|
894 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
895 |
|
896 |
# Display Chat History
|
897 |
st.subheader("Chat History ๐")
|
|
|
908 |
with st.chat_message(message["role"]):
|
909 |
st.markdown(message["content"])
|
910 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
911 |
|
912 |
# Chat Interface
|
913 |
user_input = st.text_area("Message:", height=100)
|