Spaces:
Sleeping
Sleeping
update readme
Browse files- Home.py +3 -3
- README.md +1 -1
- pages/Gallery.py +15 -0
Home.py
CHANGED
@@ -33,9 +33,9 @@ def save_user_id(user_id):
|
|
33 |
|
34 |
|
35 |
def logout():
|
36 |
-
st.session_state.pop('user_id')
|
37 |
-
st.session_state.pop('selected_dict')
|
38 |
-
st.session_state.pop('score_weights')
|
39 |
|
40 |
|
41 |
if __name__ == '__main__':
|
|
|
33 |
|
34 |
|
35 |
def logout():
|
36 |
+
st.session_state.pop('user_id', None)
|
37 |
+
st.session_state.pop('selected_dict', None)
|
38 |
+
st.session_state.pop('score_weights', None)
|
39 |
|
40 |
|
41 |
if __name__ == '__main__':
|
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title: GEMRec-
|
3 |
emoji: 🖼️
|
4 |
colorFrom: blue
|
5 |
colorTo: purple
|
|
|
1 |
---
|
2 |
+
title: GEMRec-Gallery
|
3 |
emoji: 🖼️
|
4 |
colorFrom: blue
|
5 |
colorTo: purple
|
pages/Gallery.py
CHANGED
@@ -5,6 +5,7 @@ import altair as alt
|
|
5 |
import numpy as np
|
6 |
import pandas as pd
|
7 |
import streamlit as st
|
|
|
8 |
|
9 |
from bs4 import BeautifulSoup
|
10 |
from datasets import load_dataset, Dataset, load_from_disk
|
@@ -497,6 +498,7 @@ class GalleryApp:
|
|
497 |
# normalize optimal_weight
|
498 |
optimal_weight = [round(weight/len(selected), 2) for weight in optimal_weight]
|
499 |
print('optimal weight:', optimal_weight)
|
|
|
500 |
|
501 |
st.session_state.score_weights[0: 3] = optimal_weight
|
502 |
|
@@ -619,3 +621,16 @@ if __name__ == "__main__":
|
|
619 |
|
620 |
app = GalleryApp(promptBook=promptBook, images_ds=images_ds)
|
621 |
app.app()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
import numpy as np
|
6 |
import pandas as pd
|
7 |
import streamlit as st
|
8 |
+
import streamlit.components.v1 as components
|
9 |
|
10 |
from bs4 import BeautifulSoup
|
11 |
from datasets import load_dataset, Dataset, load_from_disk
|
|
|
498 |
# normalize optimal_weight
|
499 |
optimal_weight = [round(weight/len(selected), 2) for weight in optimal_weight]
|
500 |
print('optimal weight:', optimal_weight)
|
501 |
+
print('optimal weight:', optimal_weight)
|
502 |
|
503 |
st.session_state.score_weights[0: 3] = optimal_weight
|
504 |
|
|
|
621 |
|
622 |
app = GalleryApp(promptBook=promptBook, images_ds=images_ds)
|
623 |
app.app()
|
624 |
+
|
625 |
+
# components.html(
|
626 |
+
# """
|
627 |
+
# <script>
|
628 |
+
# var iframe = window.parent.document.querySelector('[title="streamlit_agraph.agraph"]');
|
629 |
+
# console.log(iframe);
|
630 |
+
# var targetElement = iframe.contentDocument.querySelector('div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends');
|
631 |
+
# console.log(targetElement);
|
632 |
+
# targetElement.style.background-image = "url(https://www.flaticon.com/free-icon-font/menu-burger_3917215?related_id=3917215#)";
|
633 |
+
# </script>
|
634 |
+
# """,
|
635 |
+
# # unsafe_allow_html=True,
|
636 |
+
# )
|