Spaces:
Sleeping
Sleeping
import streamlit as st | |
def main(): | |
st.title("Data Loading") | |
# Introduction or instruction | |
st.write("Select directories and file types to process from the configured data source.") | |
# Assume we have a function `list_repo_directories(repo_url)` that returns a list of directories in the repo | |
# This is a placeholder list to demonstrate UI elements | |
directories = ["src", "docs", "examples", "tests"] # Example directory names | |
# Directory selection | |
selected_directories = st.multiselect("Select Directories", options=directories, default=directories) | |
if selected_directories: | |
# Save the selected directories for later processing | |
st.session_state['selected_directories'] = selected_directories | |
st.success(f"Selected directories: {', '.join(selected_directories)}") | |
else: | |
st.error("Please select at least one directory.") | |
# File type filtering | |
file_types = ["pdf", "txt", "md"] # Example file types | |
selected_file_types = st.multiselect("Select File Types to Include", options=file_types, default=file_types) | |
if selected_file_types: | |
# Save the selected file types for later processing | |
st.session_state['selected_file_types'] = selected_file_types | |
st.success(f"Selected file types: {', '.join(selected_file_types)}") | |
else: | |
st.error("Please select at least one file type.") | |
# Optional: Navigation or action buttons | |
# Example: Button to proceed to the next step if this page's task is completed | |
if st.button("Proceed to Model Selection and Configuration"): | |
# Change the page in the session state, assuming you have set up session-based navigation in app.py | |
st.session_state.page = 'model_selection' | |
if __name__ == "__main__": | |
main() | |