Spaces:
Sleeping
Sleeping
add default expand
Browse files- Home.py +1 -1
- pages/Gallery.py +11 -3
Home.py
CHANGED
@@ -74,7 +74,7 @@ if __name__ == '__main__':
|
|
74 |
st.set_page_config(page_title="Login", page_icon="๐ ", layout="wide")
|
75 |
info()
|
76 |
st.write('A Research by [MAPS Lab](https://whongyi.github.io/MAPS-research), [NYU Shanghai](https://shanghai.nyu.edu)')
|
77 |
-
st.title("๐ Welcome to GEMRec Gallery
|
78 |
# st.info("Getting obsessed with tons of different text-to-image generation models available online? \n \
|
79 |
# Want to find the most suitable one for your taste? \n \
|
80 |
# **GEMRec** is here to help you!"
|
|
|
74 |
st.set_page_config(page_title="Login", page_icon="๐ ", layout="wide")
|
75 |
info()
|
76 |
st.write('A Research by [MAPS Lab](https://whongyi.github.io/MAPS-research), [NYU Shanghai](https://shanghai.nyu.edu)')
|
77 |
+
st.title("๐ Welcome to GEMRec Gallery!")
|
78 |
# st.info("Getting obsessed with tons of different text-to-image generation models available online? \n \
|
79 |
# Want to find the most suitable one for your taste? \n \
|
80 |
# **GEMRec** is here to help you!"
|
pages/Gallery.py
CHANGED
@@ -372,14 +372,22 @@ class GalleryApp:
|
|
372 |
def checkout_mode(self, tag, items):
|
373 |
# st.write(items)
|
374 |
if len(items) > 0:
|
375 |
-
|
|
|
|
|
376 |
prompt = items[items['prompt_id'] == prompt_id]['prompt'].unique()[0]
|
377 |
-
default_expand = True if st.session_state.gallery_focus['prompt'] == prompt else False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
with st.expander(f'**{prompt}**', expanded=default_expand):
|
379 |
# st.caption('select info to show')
|
380 |
checkout_panel = st.columns([5, 3])
|
381 |
with checkout_panel[0]:
|
382 |
-
pass
|
383 |
info = st.multiselect('Show Info',
|
384 |
['model_name', 'model_id', 'modelVersion_name', 'modelVersion_id',
|
385 |
'total_score', 'model_download_count', 'clip_score', 'mcos_score',
|
|
|
372 |
def checkout_mode(self, tag, items):
|
373 |
# st.write(items)
|
374 |
if len(items) > 0:
|
375 |
+
prompt_ids = items['prompt_id'].unique()
|
376 |
+
for i in range(len(prompt_ids)):
|
377 |
+
prompt_id = prompt_ids[i]
|
378 |
prompt = items[items['prompt_id'] == prompt_id]['prompt'].unique()[0]
|
379 |
+
# default_expand = True if st.session_state.gallery_focus['prompt'] == prompt else False
|
380 |
+
if tag == st.session_state.gallery_focus['tag'] and prompt == st.session_state.gallery_focus['prompt']:
|
381 |
+
default_expand = True
|
382 |
+
elif tag != st.session_state.gallery_focus['tag'] and i==0:
|
383 |
+
default_expand = True
|
384 |
+
else:
|
385 |
+
default_expand = False
|
386 |
+
|
387 |
with st.expander(f'**{prompt}**', expanded=default_expand):
|
388 |
# st.caption('select info to show')
|
389 |
checkout_panel = st.columns([5, 3])
|
390 |
with checkout_panel[0]:
|
|
|
391 |
info = st.multiselect('Show Info',
|
392 |
['model_name', 'model_id', 'modelVersion_name', 'modelVersion_id',
|
393 |
'total_score', 'model_download_count', 'clip_score', 'mcos_score',
|