Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
|
| 2 |
import streamlit as st
|
| 3 |
-
|
| 4 |
-
import
|
| 5 |
|
| 6 |
# Set the Streamlit page configuration
|
| 7 |
set_page_config()
|
|
@@ -12,28 +12,30 @@ st.title("CodeGen Hub")
|
|
| 12 |
# App description with markdown formatting
|
| 13 |
st.markdown("""
|
| 14 |
Welcome to CodeGen Hub - A platform for training and using code generation models with Hugging Face integration.
|
| 15 |
-
|
| 16 |
### Core Features:
|
| 17 |
- π Upload and preprocess Python code datasets for model training
|
| 18 |
- ποΈ Configure and train models with customizable parameters
|
| 19 |
- π€ Generate code predictions using trained models through an interactive interface
|
| 20 |
- π Monitor training progress with visualizations and detailed logs
|
| 21 |
- π Seamless integration with Hugging Face Hub for model management
|
| 22 |
-
|
| 23 |
Navigate through the different sections using the sidebar menu.
|
| 24 |
""")
|
| 25 |
|
|
|
|
| 26 |
# Sidebar navigation using session state
|
| 27 |
def navigate(page):
|
| 28 |
st.session_state["current_page"] = page
|
| 29 |
|
|
|
|
| 30 |
# Initialize session state variables using a loop
|
| 31 |
session_defaults = {
|
| 32 |
-
"datasets": {},
|
| 33 |
"trained_models": {}, # Stores trained model details
|
| 34 |
-
"training_logs": [],
|
| 35 |
"training_progress": {}, # Tracks active training jobs
|
| 36 |
-
"current_page": "home" # Default landing page
|
| 37 |
}
|
| 38 |
|
| 39 |
for key, value in session_defaults.items():
|
|
@@ -81,12 +83,15 @@ st.subheader("Platform Statistics")
|
|
| 81 |
col1, col2, col3 = st.columns(3)
|
| 82 |
|
| 83 |
with col1:
|
| 84 |
-
st.metric("π Datasets Available", len(st.session_state.get("datasets",
|
|
|
|
| 85 |
|
| 86 |
with col2:
|
| 87 |
-
st.metric("π¦ Trained Models",
|
|
|
|
| 88 |
|
| 89 |
with col3:
|
| 90 |
-
active_jobs = sum(
|
| 91 |
-
|
|
|
|
| 92 |
st.metric("π Active Training Jobs", active_jobs)
|
|
|
|
| 1 |
|
| 2 |
import streamlit as st
|
| 3 |
+
|
| 4 |
+
from utils import set_page_config
|
| 5 |
|
| 6 |
# Set the Streamlit page configuration
|
| 7 |
set_page_config()
|
|
|
|
| 12 |
# App description with markdown formatting
|
| 13 |
st.markdown("""
|
| 14 |
Welcome to CodeGen Hub - A platform for training and using code generation models with Hugging Face integration.
|
| 15 |
+
|
| 16 |
### Core Features:
|
| 17 |
- π Upload and preprocess Python code datasets for model training
|
| 18 |
- ποΈ Configure and train models with customizable parameters
|
| 19 |
- π€ Generate code predictions using trained models through an interactive interface
|
| 20 |
- π Monitor training progress with visualizations and detailed logs
|
| 21 |
- π Seamless integration with Hugging Face Hub for model management
|
| 22 |
+
|
| 23 |
Navigate through the different sections using the sidebar menu.
|
| 24 |
""")
|
| 25 |
|
| 26 |
+
|
| 27 |
# Sidebar navigation using session state
|
| 28 |
def navigate(page):
|
| 29 |
st.session_state["current_page"] = page
|
| 30 |
|
| 31 |
+
|
| 32 |
# Initialize session state variables using a loop
|
| 33 |
session_defaults = {
|
| 34 |
+
"datasets": {}, # Stores uploaded datasets
|
| 35 |
"trained_models": {}, # Stores trained model details
|
| 36 |
+
"training_logs": [], # Stores training logs
|
| 37 |
"training_progress": {}, # Tracks active training jobs
|
| 38 |
+
"current_page": "home", # Default landing page
|
| 39 |
}
|
| 40 |
|
| 41 |
for key, value in session_defaults.items():
|
|
|
|
| 83 |
col1, col2, col3 = st.columns(3)
|
| 84 |
|
| 85 |
with col1:
|
| 86 |
+
st.metric("π Datasets Available", len(st.session_state.get("datasets",
|
| 87 |
+
{})))
|
| 88 |
|
| 89 |
with col2:
|
| 90 |
+
st.metric("π¦ Trained Models",
|
| 91 |
+
len(st.session_state.get("trained_models", {})))
|
| 92 |
|
| 93 |
with col3:
|
| 94 |
+
active_jobs = sum(
|
| 95 |
+
1 for progress in st.session_state["training_progress"].values()
|
| 96 |
+
if progress.get("status") == "running")
|
| 97 |
st.metric("π Active Training Jobs", active_jobs)
|