File size: 2,287 Bytes
5dd070e
f528fb2
 
c541f79
f528fb2
5dd070e
 
f528fb2
5dd070e
 
 
f528fb2
5dd070e
f528fb2
 
 
 
 
 
5dd070e
 
 
f528fb2
 
c541f79
f528fb2
 
 
5dd070e
f528fb2
 
c541f79
f528fb2
 
5dd070e
f528fb2
 
5dd070e
 
 
f528fb2
 
 
5dd070e
f528fb2
 
 
 
 
 
 
 
 
 
 
5dd070e
f528fb2
5dd070e
 
 
 
f528fb2
 
5dd070e
f528fb2
 
5dd070e
f528fb2
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import streamlit as st
from utils import set_page_config, display_sidebar
import os

# Set page configuration
set_page_config()

# Title and description
st.title("CodeGen Hub")
st.markdown("""
    Welcome to CodeGen Hub - A platform for training and using code generation models with Hugging Face integration.
    
    ### Core Features:
    - Upload and preprocess Python code datasets for model training
    - Configure and train models with customizable parameters
    - Generate code predictions using trained models through an interactive interface
    - Monitor training progress with visualizations and detailed logs
    - Seamless integration with Hugging Face Hub for model management
    
    Navigate through the different sections using the sidebar menu.
""")

# Display sidebar
display_sidebar()

# Create the session state for storing information across app pages
if 'datasets' not in st.session_state:
    st.session_state.datasets = {}

if 'trained_models' not in st.session_state:
    st.session_state.trained_models = {}

if 'training_logs' not in st.session_state:
    st.session_state.training_logs = []

if 'training_progress' not in st.session_state:
    st.session_state.training_progress = {}



# Display getting started card
st.subheader("Getting Started")
col1, col2 = st.columns(2)

with col1:
    st.info("""
        1. πŸ“Š Start by uploading or selecting a Python code dataset in the **Dataset Management** section.
        2. πŸ› οΈ Configure and train your model in the **Model Training** section.
    """)
    
with col2:
    st.info("""
        3. πŸ’‘ Generate code predictions using your trained models in the **Code Generation** section.
        4. πŸ”„ Access your models on Hugging Face Hub for broader use.
    """)

# Display platform statistics if available
st.subheader("Platform Statistics")
col1, col2, col3 = st.columns(3)

with col1:
    st.metric("Datasets Available", len(st.session_state.datasets))
    
with col2:
    st.metric("Trained Models", len(st.session_state.trained_models))
    
with col3:
    # Calculate active training jobs
    active_jobs = sum(1 for progress in st.session_state.training_progress.values() 
                     if progress.get('status') == 'running')
    st.metric("Active Training Jobs", active_jobs)