Spaces:
Sleeping
Sleeping
Update pages/📖History_Mystery.py
#3
by
MARI-posa
- opened
- pages/📖History_Mystery.py +51 -0
pages/📖History_Mystery.py
CHANGED
@@ -4,6 +4,57 @@ from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
|
4 |
import numpy as np
|
5 |
from PIL import Image
|
6 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
st.title("""
|
8 |
History Mystery
|
9 |
""")
|
|
|
4 |
import numpy as np
|
5 |
from PIL import Image
|
6 |
import torch
|
7 |
+
|
8 |
+
import base64
|
9 |
+
import plotly.express as px
|
10 |
+
|
11 |
+
df = px.data.iris()
|
12 |
+
|
13 |
+
@st.cache_data
|
14 |
+
def get_img_as_base64(file):
|
15 |
+
with open(file, "rb") as f:
|
16 |
+
data = f.read()
|
17 |
+
return base64.b64encode(data).decode()
|
18 |
+
|
19 |
+
|
20 |
+
page_bg_img = f"""
|
21 |
+
<style>
|
22 |
+
[data-testid="stAppViewContainer"] > .main {{
|
23 |
+
background-image: url("https://wallpapercave.com/wp/wp6480460.jpg");
|
24 |
+
background-size: 115%;
|
25 |
+
background-position: top left;
|
26 |
+
background-repeat: no-repeat;
|
27 |
+
background-attachment: local;
|
28 |
+
}}
|
29 |
+
|
30 |
+
[data-testid="stSidebar"] > div:first-child {{
|
31 |
+
background-image: url("https://ibb.co/ZBkdJRg");
|
32 |
+
background-size: 115%;
|
33 |
+
background-position: center;
|
34 |
+
background-repeat: no-repeat;
|
35 |
+
background-attachment: fixed;
|
36 |
+
}}
|
37 |
+
|
38 |
+
[data-testid="stHeader"] {{
|
39 |
+
background: rgba(0,0,0,0);
|
40 |
+
}}
|
41 |
+
|
42 |
+
[data-testid="stToolbar"] {{
|
43 |
+
right: 2rem;
|
44 |
+
}}
|
45 |
+
|
46 |
+
div.css-1n76uvr.e1tzin5v0 {{
|
47 |
+
background-color: rgba(238, 238, 238, 0.5);
|
48 |
+
border: 10px solid #EEEEEE;
|
49 |
+
padding: 5% 5% 5% 10%;
|
50 |
+
border-radius: 5px;
|
51 |
+
}}
|
52 |
+
|
53 |
+
|
54 |
+
</style>
|
55 |
+
"""
|
56 |
+
st.markdown(page_bg_img, unsafe_allow_html=True)
|
57 |
+
|
58 |
st.title("""
|
59 |
History Mystery
|
60 |
""")
|