Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -423,21 +423,23 @@ def display_papers(papers):
|
|
| 423 |
Display papers with their audio controls using URLs as unique keys.
|
| 424 |
"""
|
| 425 |
st.write("## Research Papers")
|
| 426 |
-
|
| 427 |
for idx, paper in enumerate(papers):
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
st.
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
|
|
|
|
|
|
| 441 |
|
| 442 |
def perform_ai_lookup(q, vocal_summary=True, extended_refs=False,
|
| 443 |
titles_summary=True, full_audio=False):
|
|
|
|
| 423 |
Display papers with their audio controls using URLs as unique keys.
|
| 424 |
"""
|
| 425 |
st.write("## Research Papers")
|
| 426 |
+
papercount=0
|
| 427 |
for idx, paper in enumerate(papers):
|
| 428 |
+
papercount = papercount + 1
|
| 429 |
+
if (papercount<=20):
|
| 430 |
+
with st.expander(f"📄 {paper['title']}", expanded=True):
|
| 431 |
+
st.markdown(f"**{paper['date']} | {paper['title']} | ⬇️**")
|
| 432 |
+
st.markdown(f"*{paper['authors']}*")
|
| 433 |
+
st.markdown(paper['summary'])
|
| 434 |
+
|
| 435 |
+
# Single audio control for full content
|
| 436 |
+
if paper.get('full_audio'):
|
| 437 |
+
st.write("📚 Paper Audio")
|
| 438 |
+
file_ext = os.path.splitext(paper['full_audio'])[1].lower().strip('.')
|
| 439 |
+
if file_ext == "mp3":
|
| 440 |
+
st.audio(paper['full_audio'])
|
| 441 |
+
elif file_ext == "wav":
|
| 442 |
+
st.audio(paper['full_audio'])
|
| 443 |
|
| 444 |
def perform_ai_lookup(q, vocal_summary=True, extended_refs=False,
|
| 445 |
titles_summary=True, full_audio=False):
|