Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -720,7 +720,7 @@ def create_zip_of_files(md_files, mp3_files, wav_files, input_question):
|
|
| 720 |
|
| 721 |
|
| 722 |
def perform_ai_lookup(q, vocal_summary=True, extended_refs=False,
|
| 723 |
-
titles_summary=True, full_audio=False, useArxiv=True):
|
| 724 |
"""Main routine that uses Anthropic (Claude) + Gradio ArXiv RAG pipeline."""
|
| 725 |
start = time.time()
|
| 726 |
ai_constitution = """
|
|
@@ -785,7 +785,7 @@ def perform_ai_lookup(q, vocal_summary=True, extended_refs=False,
|
|
| 785 |
st.markdown(paper_links)
|
| 786 |
|
| 787 |
# Then create audio for each paper
|
| 788 |
-
if
|
| 789 |
create_paper_audio_files(papers, input_question=q)
|
| 790 |
|
| 791 |
display_papers(papers, get_marquee_settings()) # scrolling marquee per paper and summary
|
|
@@ -903,10 +903,9 @@ def display_voice_tab():
|
|
| 903 |
"""
|
| 904 |
ποΈ Display the voice input tab with TTS settings and real-time usage.
|
| 905 |
"""
|
| 906 |
-
st.subheader("π€ Voice Input")
|
| 907 |
|
| 908 |
# βΆ Voice Settings
|
| 909 |
-
st.markdown("### π€ Voice Settings")
|
| 910 |
caption_female = 'Top: πΈ **Aria** β πΆ **Jenny** β πΊ **Sonia** β π **Natasha** β π· **Clara**'
|
| 911 |
caption_male = 'Bottom: π **Guy** β π οΈ **Ryan** β π» **William** β π **Liam**'
|
| 912 |
|
|
@@ -1118,7 +1117,9 @@ def main():
|
|
| 1118 |
# βΆ 3) Main action tabs and model use choices
|
| 1119 |
tab_main = st.radio("Action:", ["π€ Voice", "πΈ Media", "π ArXiv", "π Editor"],
|
| 1120 |
horizontal=True)
|
| 1121 |
-
|
|
|
|
|
|
|
| 1122 |
|
| 1123 |
# βΆ 4) Show or hide custom component (optional example)
|
| 1124 |
mycomponent = components.declare_component("mycomponent", path="mycomponent")
|
|
@@ -1143,7 +1144,7 @@ def main():
|
|
| 1143 |
vocal_summary=True,
|
| 1144 |
extended_refs=False,
|
| 1145 |
titles_summary=True,
|
| 1146 |
-
full_audio=full_audio, useArxiv=useArxiv)
|
| 1147 |
else:
|
| 1148 |
if st.button("βΆ Run"):
|
| 1149 |
st.session_state.old_val = val
|
|
@@ -1152,7 +1153,7 @@ def main():
|
|
| 1152 |
vocal_summary=True,
|
| 1153 |
extended_refs=False,
|
| 1154 |
titles_summary=True,
|
| 1155 |
-
full_audio=full_audio, useArxiv=useArxiv)
|
| 1156 |
|
| 1157 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1158 |
# TAB: ArXiv
|
|
|
|
| 720 |
|
| 721 |
|
| 722 |
def perform_ai_lookup(q, vocal_summary=True, extended_refs=False,
|
| 723 |
+
titles_summary=True, full_audio=False, useArxiv=True, useArxivAudio=False):
|
| 724 |
"""Main routine that uses Anthropic (Claude) + Gradio ArXiv RAG pipeline."""
|
| 725 |
start = time.time()
|
| 726 |
ai_constitution = """
|
|
|
|
| 785 |
st.markdown(paper_links)
|
| 786 |
|
| 787 |
# Then create audio for each paper
|
| 788 |
+
if useArxivAudio:
|
| 789 |
create_paper_audio_files(papers, input_question=q)
|
| 790 |
|
| 791 |
display_papers(papers, get_marquee_settings()) # scrolling marquee per paper and summary
|
|
|
|
| 903 |
"""
|
| 904 |
ποΈ Display the voice input tab with TTS settings and real-time usage.
|
| 905 |
"""
|
|
|
|
| 906 |
|
| 907 |
# βΆ Voice Settings
|
| 908 |
+
st.sidebar.markdown("### π€ Voice Settings")
|
| 909 |
caption_female = 'Top: πΈ **Aria** β πΆ **Jenny** β πΊ **Sonia** β π **Natasha** β π· **Clara**'
|
| 910 |
caption_male = 'Bottom: π **Guy** β π οΈ **Ryan** β π» **William** β π **Liam**'
|
| 911 |
|
|
|
|
| 1117 |
# βΆ 3) Main action tabs and model use choices
|
| 1118 |
tab_main = st.radio("Action:", ["π€ Voice", "πΈ Media", "π ArXiv", "π Editor"],
|
| 1119 |
horizontal=True)
|
| 1120 |
+
|
| 1121 |
+
useArxiv = st.checkbox("Search Arxiv for Research Paper Answers", value=True)
|
| 1122 |
+
useArxivAudio = st.checkbox("Generate Audio File for Research Paper Answers", value=False)
|
| 1123 |
|
| 1124 |
# βΆ 4) Show or hide custom component (optional example)
|
| 1125 |
mycomponent = components.declare_component("mycomponent", path="mycomponent")
|
|
|
|
| 1144 |
vocal_summary=True,
|
| 1145 |
extended_refs=False,
|
| 1146 |
titles_summary=True,
|
| 1147 |
+
full_audio=full_audio, useArxiv=useArxiv, useArxivAudio=useArxivAudio)
|
| 1148 |
else:
|
| 1149 |
if st.button("βΆ Run"):
|
| 1150 |
st.session_state.old_val = val
|
|
|
|
| 1153 |
vocal_summary=True,
|
| 1154 |
extended_refs=False,
|
| 1155 |
titles_summary=True,
|
| 1156 |
+
full_audio=full_audio, useArxiv=useArxiv, useArxivAudio=useArxivAudio)
|
| 1157 |
|
| 1158 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1159 |
# TAB: ArXiv
|