awacke1 commited on
Commit
8b65f61
Β·
verified Β·
1 Parent(s): 4c8ec70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
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
- with st.expander(f"Line {i+1}"):
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
- with st.expander(f"{i}. {p['title']}"):
673
- st.markdown(f"[{p['date']}] [Abstract]({p['url']}) | [PDF]({p['url'].replace('abs', 'pdf')}.pdf)")
674
- if st.button(f"Load Details {i}", key=f"load_{i}"):
675
- with open(p['md_file'], 'r', encoding='utf-8') as f:
676
- st.markdown(f.read())
 
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
- st.markdown(f"{i+1}. {line}")
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)