File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 5
5
6
6
# Load a pre-trained Hugging Face model
7
7
##chatbot = pipeline("text-generation", model='distilgpt2')
8
+ # 🌙 Dark Mode Toggle Setup
9
+ if "dark_mode" not in st .session_state :
10
+ st .session_state .dark_mode = False
11
+
12
+ # Sidebar toggle
13
+ st .sidebar .title ("🛠 Settings" )
14
+ st .session_state .dark_mode = st .sidebar .checkbox ("🌙 Enable Dark Mode" , value = st .session_state .dark_mode )
15
+
16
+ # Inject CSS based on toggle
17
+ if st .session_state .dark_mode :
18
+ st .markdown ("""
19
+ <style>
20
+ body, .main { background-color: #121212; color: #e0e0e0; }
21
+ .stButton>button { background-color: #333; color: white; }
22
+ .stTextInput>div>div>input { background-color: #1e1e1e; color: white; }
23
+ </style>
24
+ """ , unsafe_allow_html = True )
25
+ else :
26
+ st .markdown ("""
27
+ <style>
28
+ body, .main { background-color: #ffffff; color: #000000; }
29
+ </style>
30
+ """ , unsafe_allow_html = True )
8
31
9
32
# Health Information Library
10
33
health_info = {
You can’t perform that action at this time.
0 commit comments