Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -596,6 +596,7 @@ def create_download_link(filename, base64_str):
|
|
596 |
href = f'<a href="data:file/png;base64,{base64_str}" download="{filename}">Download Image</a>'
|
597 |
return href
|
598 |
|
|
|
599 |
def SideBarImageShuffle():
|
600 |
image_urls = [
|
601 |
"https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/cfhJIasuxLkT5fnaAE6Gj.png",
|
@@ -733,6 +734,7 @@ def display_glossary(glossary, area):
|
|
733 |
|
734 |
|
735 |
# Function to display the entire glossary in a grid format with links
|
|
|
736 |
def display_glossary_grid(roleplaying_glossary):
|
737 |
search_urls = {
|
738 |
"📖Wiki": lambda k: f"https://en.wikipedia.org/wiki/{quote(k)}",
|
@@ -780,7 +782,7 @@ def display_videos_and_links(num_columns):
|
|
780 |
display_glossary_entity(k)
|
781 |
col_index += 1 # Increment column index to place the next video in the next column
|
782 |
|
783 |
-
|
784 |
def display_images_and_wikipedia_summaries(num_columns=4):
|
785 |
image_files = [f for f in os.listdir('.') if f.endswith('.png')]
|
786 |
if not image_files:
|
|
|
596 |
href = f'<a href="data:file/png;base64,{base64_str}" download="{filename}">Download Image</a>'
|
597 |
return href
|
598 |
|
599 |
+
@st.cache_resource
|
600 |
def SideBarImageShuffle():
|
601 |
image_urls = [
|
602 |
"https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/cfhJIasuxLkT5fnaAE6Gj.png",
|
|
|
734 |
|
735 |
|
736 |
# Function to display the entire glossary in a grid format with links
|
737 |
+
@st.cache_resource
|
738 |
def display_glossary_grid(roleplaying_glossary):
|
739 |
search_urls = {
|
740 |
"📖Wiki": lambda k: f"https://en.wikipedia.org/wiki/{quote(k)}",
|
|
|
782 |
display_glossary_entity(k)
|
783 |
col_index += 1 # Increment column index to place the next video in the next column
|
784 |
|
785 |
+
@st.cache_resource
|
786 |
def display_images_and_wikipedia_summaries(num_columns=4):
|
787 |
image_files = [f for f in os.listdir('.') if f.endswith('.png')]
|
788 |
if not image_files:
|