Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix filename in preview section of WebUI #105

Merged
merged 50 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
a477afe
first version of WEB-UI, Can run the aga, have issues with session state
Sep 5, 2024
8dd44a6
Merge branch 'autogluon:main' into streamlit-ui
tianyuanzoe Sep 5, 2024
ee5a075
can upload competition.txt file now
Sep 5, 2024
1f26e83
Merge branch 'streamlit-ui' of https://github.com/tianyuanzoe/autoglu…
Sep 5, 2024
077da4e
fixing the issues of uploaded filename disappear when users navigate …
Sep 5, 2024
ba27c98
fix the issues of download button disappear, also the task_file.txt a…
Sep 6, 2024
c35426c
make the run_autogluon_assistant() async
Sep 8, 2024
cfdc8f9
change log container to st.status()
Sep 9, 2024
467bc5d
add cancel_task button
Sep 10, 2024
a974583
preserve the log and status container between multiple pages,running …
Sep 13, 2024
4a2a358
split the file uploader
Sep 17, 2024
9775988
change the layout of task and preview page
Sep 20, 2024
b9c4d5f
before change the layout and stying to the wireframe style
Sep 23, 2024
c611fdb
version before adding the cookie
Sep 24, 2024
7e5dd6f
One page navigation
Sep 25, 2024
80b6ee9
Merge branch 'autogluon:main' into streamlit-ui
tianyuanzoe Sep 25, 2024
1778885
Merge branch 'streamlit-ui' of https://github.com/tianyuanzoe/autoglu…
Sep 25, 2024
08bea41
Merge branch 'autogluon:main' into streamlit-ui
tianyuanzoe Oct 1, 2024
9ca05f0
allow multi session
Oct 1, 2024
3b235cf
add docstring and change the logic of file uploader
Oct 4, 2024
0c4c08a
Merge branch 'autogluon:main' into streamlit-ui
tianyuanzoe Oct 14, 2024
4c52a55
Merge branch 'autogluon:main' into streamlit-ui
tianyuanzoe Oct 14, 2024
c37ab38
Merge branch 'autogluon:main' into streamlit-ui
tianyuanzoe Nov 6, 2024
15310ec
Merge pull request #1 from tianyuanzoe/streamlit-ui
tianyuanzoe Nov 6, 2024
365728e
add Autogluon-Assistant WebUI
Nov 6, 2024
67dde11
add linter
Nov 6, 2024
ae1038a
move some css
Nov 6, 2024
8afd703
remove fstring
Nov 6, 2024
591a3b2
add linter
Nov 6, 2024
243e491
sort import
Nov 6, 2024
fe6a44d
remove dataset, adding constants, preset select
Nov 8, 2024
ffe62df
Merge branch 'autogluon:main' into main
tianyuanzoe Nov 8, 2024
6088cdf
remove video
Nov 8, 2024
ca344fb
merge README,gitignore,pyproject.toml,move some css
Nov 8, 2024
0754b0a
add toast
Nov 8, 2024
797c816
delete dockerfile, change demo video and sample_dataset
Nov 9, 2024
3288397
use linter: delete dockerfile, change demo video and sample_dataset
Nov 9, 2024
1a3c754
remove video
Nov 9, 2024
3f52b29
Merge branch 'autogluon:main' into main
tianyuanzoe Nov 9, 2024
05e79a4
change READEME, remove unwanted file
Nov 9, 2024
d59ae72
Merge branch 'main' of https://github.com/tianyuanzoe/AGA-UI
Nov 9, 2024
3b280bf
fixing bugs: The widget with key _time_limit was created with a defau…
Nov 9, 2024
e45259b
remove debugging tool
Nov 9, 2024
d0ac1eb
merge from main
Nov 10, 2024
dbad930
to pop stash
Nov 10, 2024
49a8312
fix output filename in preview
Nov 11, 2024
50f1ee0
black
Nov 11, 2024
c8f0c4d
Merge branch 'autogluon:main' into fix-filename
tianyuanzoe Nov 11, 2024
f8aa2e0
isort
Nov 11, 2024
63bee54
Merge branch 'fix-filename' of https://github.com/tianyuanzoe/AGA-UI …
Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/autogluon_assistant/ui/pages/preview.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import streamlit as st
from st_aggrid import AgGrid, GridOptionsBuilder

Expand Down Expand Up @@ -44,7 +46,7 @@ def preview_dataset():
elif st.session_state.selected_dataset == "Sample Dataset":
file_options = get_sample_files()
if st.session_state.output_file is not None:
file_options.append(st.session_state.output_filename)
file_options.append(os.path.basename(st.session_state.output_filename))
selected_file = st.selectbox(
"Preview File",
options=file_options,
Expand All @@ -64,7 +66,9 @@ def preview_dataset():
""",
unsafe_allow_html=True,
)
if selected_file == st.session_state.output_filename:
if st.session_state.output_filename and selected_file == os.path.basename(
st.session_state.output_filename
):
output_file = st.session_state.output_file
gb = GridOptionsBuilder.from_dataframe(output_file)
gb.configure_pagination()
Expand Down
5 changes: 3 additions & 2 deletions src/autogluon_assistant/ui/pages/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def download_log_button():
st.download_button(
label="📥  Download Logs",
data=st.session_state.logs,
file_name=f"autogluon_logs_{st.session_state.user_session_id}.txt",
file_name="aga_logs.txt",
mime="text/plain",
)

Expand All @@ -262,7 +262,6 @@ def toggle_running_state():
st.session_state.stage_container = copy.deepcopy(INITIAL_STAGE)
st.session_state.stage_status = {}
st.session_state.increment_time = 0
st.session_state.progress_bar = None


def toggle_cancel_state():
Expand Down Expand Up @@ -409,6 +408,8 @@ def run_section():
def setup_local_dataset():
"""Download all files from GitHub directory to local directory"""
dataset_dir = Path("sample_dataset/knot_theory")
if dataset_dir.exists():
return
dataset_dir.mkdir(parents=True, exist_ok=True)

api_url = "https://api.github.com/repos/mli/ag-docs/contents/knot_theory"
Expand Down
8 changes: 2 additions & 6 deletions src/autogluon_assistant/ui/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,11 @@ def generate_output_filename():
Returns:
str: A unique filename for the output CSV file.
"""
user_session_id = get_user_session_id()
unique_id = user_session_id[:8]
user_data_dir = get_user_data_dir()
timestamp = pd.Timestamp.now().strftime("%Y%m%d_%H%M%S")
directory_path = os.path.join(unique_id, timestamp)
# Create directories if they don't exist
directory_path = os.path.join(user_data_dir, timestamp)
os.makedirs(directory_path, exist_ok=True)
# Generate full file path
output_filepath = os.path.join(directory_path, "output.csv")

return output_filepath


Expand Down
Loading