Skip to content

Commit

Permalink
feat: tags list in webui (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi authored Jun 16, 2024
1 parent e03ffdb commit b56f999
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions sksmithy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from result import Err, Ok

from sksmithy._models import EstimatorType
from sksmithy._models import EstimatorType, TagType
from sksmithy._parsers import check_duplicates, name_parser, params_parser
from sksmithy._prompts import (
PROMPT_DECISION_FUNCTION,
Expand Down Expand Up @@ -196,7 +196,24 @@ def app() -> None: # noqa: C901,PLR0912,PLR0915
st.write("#") # empty space hack

with st.container(): # forge button
_, c52, _, c54 = st.columns([2, 1, 1, 1])
c51, c52, _, c54 = st.columns([2, 1, 1, 1])

with (
c51,
st.popover(
label="Additional tags",
help=(
"To know more about tags, check the "
"[scikit-learn documentation](https://scikit-learn.org/dev/developers/develop.html#estimator-tags)"
),
),
):
tags = st.multiselect(
label="Select tags",
options=tuple(e.value for e in TagType),
help="These tags are not validated against the selected estimator type!",
key="tags",
)

with c52:
forge_btn = st.button(
Expand Down Expand Up @@ -224,6 +241,7 @@ def app() -> None: # noqa: C901,PLR0912,PLR0915
sample_weight=sample_weight,
predict_proba=predict_proba,
decision_function=decision_function,
tags=tags,
)

with c54, st.popover(label="Download", disabled=not st.session_state["forge_counter"]):
Expand All @@ -239,6 +257,8 @@ def app() -> None: # noqa: C901,PLR0912,PLR0915
key="download_btn",
)

st.write("#") # empty space hack

with st.container(): # code output
if forge_btn:
st.toast("Request submitted!")
Expand Down

0 comments on commit b56f999

Please sign in to comment.