Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1133,6 +1133,8 @@ def main():
|
|
| 1133 |
# ๐ Document handling - "Document, document, on the wall, who's the most recent of them all?"
|
| 1134 |
documents = get_documents(container)
|
| 1135 |
total_docs = len(documents)
|
|
|
|
|
|
|
| 1136 |
# Add a slider to let the user choose how many documents to display
|
| 1137 |
num_docs_to_display = st.slider(
|
| 1138 |
"Select number of documents to display", 1, 20, 1
|
|
@@ -1348,11 +1350,15 @@ def main():
|
|
| 1348 |
with open(st.session_state.current_file, 'w', encoding='utf-8') as file:
|
| 1349 |
file.write(new_content)
|
| 1350 |
st.success("File updated successfully! ๐")
|
| 1351 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1352 |
# Image Gallery (For your viewing pleasure ๐ธ)
|
| 1353 |
st.subheader("Image Gallery ๐ผ")
|
| 1354 |
image_files = glob.glob("*.png") + glob.glob("*.jpg") + glob.glob("*.jpeg")
|
| 1355 |
-
image_cols = st.slider("Gallery Columns ๐ผ", min_value=1, max_value=
|
| 1356 |
cols = st.columns(image_cols)
|
| 1357 |
for idx, image_file in enumerate(image_files):
|
| 1358 |
with cols[idx % image_cols]:
|
|
@@ -1360,26 +1366,43 @@ def main():
|
|
| 1360 |
#st.image(img, caption=image_file, use_column_width=True)
|
| 1361 |
st.image(img, use_column_width=True)
|
| 1362 |
display_glossary_entity(os.path.splitext(image_file)[0])
|
| 1363 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1364 |
# Video Gallery (Letโs roll the tapes ๐ฌ)
|
| 1365 |
st.subheader("Video Gallery ๐ฅ")
|
| 1366 |
video_files = glob.glob("*.mp4")
|
| 1367 |
-
video_cols = st.slider("Gallery Columns ๐ฌ", min_value=1, max_value=
|
| 1368 |
cols = st.columns(video_cols)
|
| 1369 |
for idx, video_file in enumerate(video_files):
|
| 1370 |
with cols[idx % video_cols]:
|
| 1371 |
st.markdown(get_video_html(video_file, width="100%"), unsafe_allow_html=True)
|
| 1372 |
display_glossary_entity(os.path.splitext(video_file)[0])
|
| 1373 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1374 |
# Audio Gallery (Tunes for the mood ๐ถ)
|
| 1375 |
st.subheader("Audio Gallery ๐ง")
|
| 1376 |
audio_files = glob.glob("*.mp3") + glob.glob("*.wav")
|
| 1377 |
-
audio_cols = st.slider("Gallery Columns ๐ถ", min_value=1, max_value=
|
| 1378 |
cols = st.columns(audio_cols)
|
| 1379 |
for idx, audio_file in enumerate(audio_files):
|
| 1380 |
with cols[idx % audio_cols]:
|
| 1381 |
st.markdown(get_audio_html(audio_file, width="100%"), unsafe_allow_html=True)
|
| 1382 |
display_glossary_entity(os.path.splitext(audio_file)[0])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1383 |
|
| 1384 |
|
| 1385 |
|
|
|
|
| 1133 |
# ๐ Document handling - "Document, document, on the wall, who's the most recent of them all?"
|
| 1134 |
documents = get_documents(container)
|
| 1135 |
total_docs = len(documents)
|
| 1136 |
+
|
| 1137 |
+
|
| 1138 |
# Add a slider to let the user choose how many documents to display
|
| 1139 |
num_docs_to_display = st.slider(
|
| 1140 |
"Select number of documents to display", 1, 20, 1
|
|
|
|
| 1350 |
with open(st.session_state.current_file, 'w', encoding='utf-8') as file:
|
| 1351 |
file.write(new_content)
|
| 1352 |
st.success("File updated successfully! ๐")
|
| 1353 |
+
|
| 1354 |
+
|
| 1355 |
+
|
| 1356 |
+
|
| 1357 |
+
|
| 1358 |
# Image Gallery (For your viewing pleasure ๐ธ)
|
| 1359 |
st.subheader("Image Gallery ๐ผ")
|
| 1360 |
image_files = glob.glob("*.png") + glob.glob("*.jpg") + glob.glob("*.jpeg")
|
| 1361 |
+
image_cols = st.slider("Gallery Columns ๐ผ", min_value=1, max_value=10, value=2)
|
| 1362 |
cols = st.columns(image_cols)
|
| 1363 |
for idx, image_file in enumerate(image_files):
|
| 1364 |
with cols[idx % image_cols]:
|
|
|
|
| 1366 |
#st.image(img, caption=image_file, use_column_width=True)
|
| 1367 |
st.image(img, use_column_width=True)
|
| 1368 |
display_glossary_entity(os.path.splitext(image_file)[0])
|
| 1369 |
+
|
| 1370 |
+
|
| 1371 |
+
|
| 1372 |
+
|
| 1373 |
+
|
| 1374 |
+
|
| 1375 |
+
|
| 1376 |
# Video Gallery (Letโs roll the tapes ๐ฌ)
|
| 1377 |
st.subheader("Video Gallery ๐ฅ")
|
| 1378 |
video_files = glob.glob("*.mp4")
|
| 1379 |
+
video_cols = st.slider("Gallery Columns ๐ฌ", min_value=1, max_value=10, value=2)
|
| 1380 |
cols = st.columns(video_cols)
|
| 1381 |
for idx, video_file in enumerate(video_files):
|
| 1382 |
with cols[idx % video_cols]:
|
| 1383 |
st.markdown(get_video_html(video_file, width="100%"), unsafe_allow_html=True)
|
| 1384 |
display_glossary_entity(os.path.splitext(video_file)[0])
|
| 1385 |
+
|
| 1386 |
+
|
| 1387 |
+
|
| 1388 |
+
|
| 1389 |
+
|
| 1390 |
+
|
| 1391 |
+
|
| 1392 |
# Audio Gallery (Tunes for the mood ๐ถ)
|
| 1393 |
st.subheader("Audio Gallery ๐ง")
|
| 1394 |
audio_files = glob.glob("*.mp3") + glob.glob("*.wav")
|
| 1395 |
+
audio_cols = st.slider("Gallery Columns ๐ถ", min_value=1, max_value=10, value=2)
|
| 1396 |
cols = st.columns(audio_cols)
|
| 1397 |
for idx, audio_file in enumerate(audio_files):
|
| 1398 |
with cols[idx % audio_cols]:
|
| 1399 |
st.markdown(get_audio_html(audio_file, width="100%"), unsafe_allow_html=True)
|
| 1400 |
display_glossary_entity(os.path.splitext(audio_file)[0])
|
| 1401 |
+
|
| 1402 |
+
|
| 1403 |
+
|
| 1404 |
+
|
| 1405 |
+
|
| 1406 |
|
| 1407 |
|
| 1408 |
|