DharavathSri commited on
Commit
301359d
·
verified ·
1 Parent(s): 33e2b92

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +83 -21
app.py CHANGED
@@ -17,32 +17,40 @@ st.set_page_config(
17
  initial_sidebar_state="expanded"
18
  )
19
 
20
- # Custom CSS for styling
21
  st.markdown("""
22
  <style>
23
  .stApp {
24
- background-color: #f5f5f5;
 
 
 
 
 
 
 
 
 
 
 
 
25
  }
26
  .stButton>button {
27
  background-color: #4CAF50;
28
- color: black;
29
  border-radius: 5px;
30
  padding: 0.5rem 1rem;
31
  border: none;
32
  }
33
- .stTextInput>div>div>input {
34
- border-radius: 5px;
35
- padding: 0.5rem;
36
- }
37
- .stSelectbox>div>div>select {
38
- border-radius: 5px;
39
- padding: 0.5rem;
40
  }
41
  .css-1aumxhk {
42
- background-color: #ffffff;
43
  border-radius: 10px;
44
  padding: 2rem;
45
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
 
46
  }
47
  .header {
48
  color: #4CAF50;
@@ -51,10 +59,63 @@ st.markdown("""
51
  margin-bottom: 1rem;
52
  }
53
  .subheader {
54
- color: #333333;
55
  font-size: 1.5rem;
56
  margin-bottom: 1rem;
57
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  </style>
59
  """, unsafe_allow_html=True)
60
 
@@ -74,6 +135,12 @@ with st.sidebar:
74
  icons=["house", "file-earmark-text", "cpu", "gear", "graph-up", "cloud-upload", "info-circle"],
75
  menu_icon="cast",
76
  default_index=0,
 
 
 
 
 
 
77
  )
78
 
79
  # Home Page
@@ -126,7 +193,7 @@ elif selected == "Data Preparation":
126
 
127
  if st.session_state['data_type'] == "text/csv":
128
  df = pd.read_csv(st.session_state['data_path'])
129
- st.dataframe(df.head())
130
  elif st.session_state['data_type'] == "application/json":
131
  with open(st.session_state['data_path']) as f:
132
  data = json.load(f)
@@ -151,7 +218,7 @@ elif selected == "Data Preparation":
151
  col3.metric("Missing Values", df.isnull().sum().sum())
152
 
153
  st.markdown("**Column Types**")
154
- st.table(df.dtypes.reset_index().rename(columns={"index": "Column", 0: "Type"}))
155
  else:
156
  st.info("Detailed statistics available for CSV files only.")
157
 
@@ -300,11 +367,6 @@ elif selected == "Deployment":
300
  with st.spinner("Uploading model to Hugging Face Hub..."):
301
  time.sleep(3)
302
 
303
- # In a real app, you would use:
304
- # api = HfApi()
305
- # api.create_repo(repo_name, private=(privacy == "Private"), token=hf_token)
306
- # api.upload_folder(folder_path=st.session_state['model_path'], repo_id=repo_name)
307
-
308
  st.success(f"Model successfully deployed to Hugging Face Hub!")
309
  st.markdown(f"Your model is available at: [https://huggingface.co/{repo_name}](https://huggingface.co/{repo_name})")
310
 
@@ -344,7 +406,7 @@ elif selected == "About":
344
  # Footer
345
  st.markdown("---")
346
  st.markdown("""
347
- <div style="text-align: center; color: #666666; font-size: 0.9rem;">
348
  LLM Fine-Tuning & Deployment App | Powered by Streamlit and Hugging Face
349
  </div>
350
  """, unsafe_allow_html=True)
 
17
  initial_sidebar_state="expanded"
18
  )
19
 
20
+ # Custom CSS for dark theme
21
  st.markdown("""
22
  <style>
23
  .stApp {
24
+ background-color: #000000;
25
+ color: #ffffff;
26
+ }
27
+ .stTextInput>div>div>input, .stTextArea>div>div>textarea {
28
+ background-color: #1a1a1a;
29
+ color: #ffffff;
30
+ }
31
+ .stSelectbox>div>div>select {
32
+ background-color: #1a1a1a;
33
+ color: #ffffff;
34
+ }
35
+ .stSlider>div>div>div>div {
36
+ background-color: #4CAF50;
37
  }
38
  .stButton>button {
39
  background-color: #4CAF50;
40
+ color: white;
41
  border-radius: 5px;
42
  padding: 0.5rem 1rem;
43
  border: none;
44
  }
45
+ .stButton>button:hover {
46
+ background-color: #45a049;
 
 
 
 
 
47
  }
48
  .css-1aumxhk {
49
+ background-color: #121212;
50
  border-radius: 10px;
51
  padding: 2rem;
52
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
53
+ color: #ffffff;
54
  }
55
  .header {
56
  color: #4CAF50;
 
59
  margin-bottom: 1rem;
60
  }
61
  .subheader {
62
+ color: #4CAF50;
63
  font-size: 1.5rem;
64
  margin-bottom: 1rem;
65
  }
66
+ .st-bb {
67
+ background-color: transparent;
68
+ }
69
+ .st-at {
70
+ background-color: #1a1a1a;
71
+ }
72
+ .st-bh {
73
+ color: #ffffff;
74
+ }
75
+ .st-ag {
76
+ font-size: 1rem;
77
+ color: #ffffff;
78
+ }
79
+ .st-ae {
80
+ background-color: #1a1a1a;
81
+ }
82
+ .st-af {
83
+ color: #ffffff;
84
+ }
85
+ .stProgress>div>div>div>div {
86
+ background-color: #4CAF50;
87
+ }
88
+ div[data-baseweb="select"]>div {
89
+ background-color: #1a1a1a;
90
+ color: white;
91
+ }
92
+ .st-b7 {
93
+ background-color: transparent;
94
+ }
95
+ .st-b8 {
96
+ color: #ffffff;
97
+ }
98
+ .st-b9 {
99
+ background-color: #1a1a1a;
100
+ }
101
+ .st-ba {
102
+ color: #ffffff;
103
+ }
104
+ .stRadio>div {
105
+ color: #ffffff;
106
+ }
107
+ .stCheckbox>div>label>div {
108
+ color: #ffffff;
109
+ }
110
+ .stFileUploader>div>div>div>div {
111
+ color: #ffffff;
112
+ }
113
+ .stMarkdown {
114
+ color: #ffffff;
115
+ }
116
+ .stAlert {
117
+ background-color: #1a1a1a;
118
+ }
119
  </style>
120
  """, unsafe_allow_html=True)
121
 
 
135
  icons=["house", "file-earmark-text", "cpu", "gear", "graph-up", "cloud-upload", "info-circle"],
136
  menu_icon="cast",
137
  default_index=0,
138
+ styles={
139
+ "container": {"padding": "5px", "background-color": "#121212"},
140
+ "icon": {"color": "#4CAF50", "font-size": "18px"},
141
+ "nav-link": {"color": "#ffffff", "font-size": "16px", "text-align": "left", "margin": "0px"},
142
+ "nav-link-selected": {"background-color": "#4CAF50", "color": "#ffffff"},
143
+ }
144
  )
145
 
146
  # Home Page
 
193
 
194
  if st.session_state['data_type'] == "text/csv":
195
  df = pd.read_csv(st.session_state['data_path'])
196
+ st.dataframe(df.head().style.set_properties(**{'background-color': '#1a1a1a', 'color': 'white'}))
197
  elif st.session_state['data_type'] == "application/json":
198
  with open(st.session_state['data_path']) as f:
199
  data = json.load(f)
 
218
  col3.metric("Missing Values", df.isnull().sum().sum())
219
 
220
  st.markdown("**Column Types**")
221
+ st.table(df.dtypes.reset_index().rename(columns={"index": "Column", 0: "Type"}).style.set_properties(**{'background-color': '#1a1a1a', 'color': 'white'}))
222
  else:
223
  st.info("Detailed statistics available for CSV files only.")
224
 
 
367
  with st.spinner("Uploading model to Hugging Face Hub..."):
368
  time.sleep(3)
369
 
 
 
 
 
 
370
  st.success(f"Model successfully deployed to Hugging Face Hub!")
371
  st.markdown(f"Your model is available at: [https://huggingface.co/{repo_name}](https://huggingface.co/{repo_name})")
372
 
 
406
  # Footer
407
  st.markdown("---")
408
  st.markdown("""
409
+ <div style="text-align: center; color: #4CAF50; font-size: 0.9rem;">
410
  LLM Fine-Tuning & Deployment App | Powered by Streamlit and Hugging Face
411
  </div>
412
  """, unsafe_allow_html=True)