Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -357,4 +357,106 @@ def main():
|
|
| 357 |
st.write("No video files found")
|
| 358 |
|
| 359 |
with media_tabs[2]:
|
| 360 |
-
image_files = glob.glob("*.png") + glob.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 357 |
st.write("No video files found")
|
| 358 |
|
| 359 |
with media_tabs[2]:
|
| 360 |
+
image_files = glob.glob("*.png") + glob.glob("*.jpg") + glob.glob("*.jpeg")
|
| 361 |
+
if image_files:
|
| 362 |
+
cols = st.columns(3)
|
| 363 |
+
for idx, image_file in enumerate(image_files):
|
| 364 |
+
with cols[idx % 3]:
|
| 365 |
+
st.image(Image.open(image_file), use_column_width=True)
|
| 366 |
+
st.markdown(get_download_link(image_file), unsafe_allow_html=True)
|
| 367 |
+
else:
|
| 368 |
+
st.write("No image files found")
|
| 369 |
+
|
| 370 |
+
with tabs[3]:
|
| 371 |
+
st.header("Advanced Settings")
|
| 372 |
+
|
| 373 |
+
st.subheader("Audio Settings")
|
| 374 |
+
audio_settings = {
|
| 375 |
+
'quality': st.select_slider(
|
| 376 |
+
"Audio Quality",
|
| 377 |
+
options=["Low", "Medium", "High"],
|
| 378 |
+
value="Medium"
|
| 379 |
+
),
|
| 380 |
+
'save_history': st.checkbox(
|
| 381 |
+
"Save Audio History",
|
| 382 |
+
value=True,
|
| 383 |
+
help="Save generated audio files in history"
|
| 384 |
+
),
|
| 385 |
+
'max_duration': st.slider(
|
| 386 |
+
"Max Audio Duration (seconds)",
|
| 387 |
+
min_value=30,
|
| 388 |
+
max_value=300,
|
| 389 |
+
value=120,
|
| 390 |
+
step=30
|
| 391 |
+
)
|
| 392 |
+
}
|
| 393 |
+
|
| 394 |
+
st.subheader("Search Settings")
|
| 395 |
+
search_settings = {
|
| 396 |
+
'max_results': st.slider(
|
| 397 |
+
"Max Search Results",
|
| 398 |
+
min_value=5,
|
| 399 |
+
max_value=50,
|
| 400 |
+
value=20
|
| 401 |
+
),
|
| 402 |
+
'include_citations': st.checkbox(
|
| 403 |
+
"Include Citations",
|
| 404 |
+
value=True
|
| 405 |
+
),
|
| 406 |
+
'auto_summarize': st.checkbox(
|
| 407 |
+
"Auto-Summarize Results",
|
| 408 |
+
value=True
|
| 409 |
+
)
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
st.subheader("File Management")
|
| 413 |
+
file_settings = {
|
| 414 |
+
'auto_cleanup': st.checkbox(
|
| 415 |
+
"Auto-cleanup Old Files",
|
| 416 |
+
value=False,
|
| 417 |
+
help="Automatically remove files older than the specified duration"
|
| 418 |
+
)
|
| 419 |
+
}
|
| 420 |
+
if file_settings['auto_cleanup']:
|
| 421 |
+
file_settings['cleanup_days'] = st.number_input(
|
| 422 |
+
"Days to keep files",
|
| 423 |
+
min_value=1,
|
| 424 |
+
max_value=30,
|
| 425 |
+
value=7
|
| 426 |
+
)
|
| 427 |
+
|
| 428 |
+
# 10. Custom CSS Styling
|
| 429 |
+
st.markdown("""
|
| 430 |
+
<style>
|
| 431 |
+
.main {
|
| 432 |
+
background: linear-gradient(135deg, #f5f7fa 0%, #e8edf5 100%);
|
| 433 |
+
}
|
| 434 |
+
.stButton>button {
|
| 435 |
+
background-color: #4CAF50;
|
| 436 |
+
color: white;
|
| 437 |
+
padding: 0.5rem 1rem;
|
| 438 |
+
border-radius: 5px;
|
| 439 |
+
border: none;
|
| 440 |
+
transition: background-color 0.3s;
|
| 441 |
+
}
|
| 442 |
+
.stButton>button:hover {
|
| 443 |
+
background-color: #45a049;
|
| 444 |
+
}
|
| 445 |
+
.audio-player {
|
| 446 |
+
margin: 1rem 0;
|
| 447 |
+
padding: 1rem;
|
| 448 |
+
border-radius: 10px;
|
| 449 |
+
background: white;
|
| 450 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
| 451 |
+
}
|
| 452 |
+
.file-manager {
|
| 453 |
+
padding: 1rem;
|
| 454 |
+
background: white;
|
| 455 |
+
border-radius: 10px;
|
| 456 |
+
margin: 1rem 0;
|
| 457 |
+
}
|
| 458 |
+
</style>
|
| 459 |
+
""", unsafe_allow_html=True)
|
| 460 |
+
|
| 461 |
+
if __name__ == "__main__":
|
| 462 |
+
main()
|