Update app.py
Browse files
app.py
CHANGED
@@ -592,9 +592,8 @@ def main():
|
|
592 |
chat_content = asyncio.run(load_chat())
|
593 |
chat_container = st.container()
|
594 |
with chat_container:
|
595 |
-
for i, line in enumerate(chat_content)
|
596 |
-
|
597 |
-
st.markdown(line)
|
598 |
|
599 |
message = st.text_input(f"Message as {st.session_state.username}", key="message_input")
|
600 |
paste_result = paste_image_button("π Paste Image or Text", key="paste_button_msg")
|
@@ -669,11 +668,12 @@ def main():
|
|
669 |
result, papers = asyncio.run(perform_ai_lookup(q, useArxiv=useArxiv, useArxivAudio=useArxivAudio))
|
670 |
st.markdown(f"### Query: {q}")
|
671 |
for i, p in enumerate(papers, 1):
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
|
|
677 |
|
678 |
# π PDF to Audio
|
679 |
elif tab_main == "π PDF to Audio":
|
@@ -738,8 +738,8 @@ def main():
|
|
738 |
st.sidebar.markdown("### π¬ Chat Dialog")
|
739 |
chat_content = asyncio.run(load_chat())
|
740 |
with st.sidebar.expander("Chat History"):
|
741 |
-
for i, line in enumerate(chat_content)
|
742 |
-
|
743 |
|
744 |
st.sidebar.subheader("Vote Totals")
|
745 |
chat_votes = load_votes(QUOTE_VOTES_FILE)
|
|
|
592 |
chat_content = asyncio.run(load_chat())
|
593 |
chat_container = st.container()
|
594 |
with chat_container:
|
595 |
+
numbered_content = "\n".join(f"{i+1}. {line}" for i, line in enumerate(chat_content))
|
596 |
+
st.code(numbered_content, language="python")
|
|
|
597 |
|
598 |
message = st.text_input(f"Message as {st.session_state.username}", key="message_input")
|
599 |
paste_result = paste_image_button("π Paste Image or Text", key="paste_button_msg")
|
|
|
668 |
result, papers = asyncio.run(perform_ai_lookup(q, useArxiv=useArxiv, useArxivAudio=useArxivAudio))
|
669 |
st.markdown(f"### Query: {q}")
|
670 |
for i, p in enumerate(papers, 1):
|
671 |
+
expander_label = f"{p['title']} | [arXiv Link]({p['url']})"
|
672 |
+
with st.expander(expander_label):
|
673 |
+
with open(p['md_file'], 'r', encoding='utf-8') as f:
|
674 |
+
content = f.read()
|
675 |
+
numbered_content = "\n".join(f"{j+1}. {line}" for j, line in enumerate(content.split('\n')))
|
676 |
+
st.code(numbered_content, language="python")
|
677 |
|
678 |
# π PDF to Audio
|
679 |
elif tab_main == "π PDF to Audio":
|
|
|
738 |
st.sidebar.markdown("### π¬ Chat Dialog")
|
739 |
chat_content = asyncio.run(load_chat())
|
740 |
with st.sidebar.expander("Chat History"):
|
741 |
+
numbered_content = "\n".join(f"{i+1}. {line}" for i, line in enumerate(chat_content))
|
742 |
+
st.code(numbered_content, language="python")
|
743 |
|
744 |
st.sidebar.subheader("Vote Totals")
|
745 |
chat_votes = load_votes(QUOTE_VOTES_FILE)
|