Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import streamlit as st
|
2 |
from huggingface_hub import HfApi
|
3 |
-
import pandas as pd
|
4 |
import asyncio
|
5 |
import os
|
6 |
|
@@ -45,6 +44,11 @@ async def fetch_all_users(usernames):
|
|
45 |
tasks = [fetch_user_content(username) for username in usernames]
|
46 |
return await asyncio.gather(*tasks)
|
47 |
|
|
|
|
|
|
|
|
|
|
|
48 |
# Generate HTML content for a user and save it to a file - because who doesn't love a good download link? 💾
|
49 |
def generate_html_page(username, models, datasets):
|
50 |
html_content = f"""
|
@@ -84,11 +88,6 @@ def generate_html_page(username, models, datasets):
|
|
84 |
|
85 |
return html_file_path
|
86 |
|
87 |
-
# Cache the HTML generation process using Streamlit's caching decorator - because no one likes to repeat themselves! 🔁
|
88 |
-
@st.cache_data(show_spinner=False)
|
89 |
-
def get_cached_html_page(username, models, datasets):
|
90 |
-
return generate_html_page(username, models, datasets)
|
91 |
-
|
92 |
# Streamlit app setup - the nerve center of our operation! 🎛️
|
93 |
st.title("Hugging Face User Content Display - Let's Automate Some Fun! 🎉")
|
94 |
|
|
|
1 |
import streamlit as st
|
2 |
from huggingface_hub import HfApi
|
|
|
3 |
import asyncio
|
4 |
import os
|
5 |
|
|
|
44 |
tasks = [fetch_user_content(username) for username in usernames]
|
45 |
return await asyncio.gather(*tasks)
|
46 |
|
47 |
+
# Cache the HTML generation process using Streamlit's caching decorator
|
48 |
+
@st.cache_data(show_spinner=False)
|
49 |
+
def get_cached_html_page(_username, _models, _datasets):
|
50 |
+
return generate_html_page(_username, _models, _datasets)
|
51 |
+
|
52 |
# Generate HTML content for a user and save it to a file - because who doesn't love a good download link? 💾
|
53 |
def generate_html_page(username, models, datasets):
|
54 |
html_content = f"""
|
|
|
88 |
|
89 |
return html_file_path
|
90 |
|
|
|
|
|
|
|
|
|
|
|
91 |
# Streamlit app setup - the nerve center of our operation! 🎛️
|
92 |
st.title("Hugging Face User Content Display - Let's Automate Some Fun! 🎉")
|
93 |
|