From 05cb2467278c2177fd2ea57c987f23eeba3d5d3a Mon Sep 17 00:00:00 2001 From: clr-li <111320104+clr-li@users.noreply.github.com> Date: Thu, 15 Feb 2024 15:08:14 -0800 Subject: [PATCH] Started dropdown --- daras_ai_v2/base.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/daras_ai_v2/base.py b/daras_ai_v2/base.py index ee8b40ca5..e61bf647e 100644 --- a/daras_ai_v2/base.py +++ b/daras_ai_v2/base.py @@ -1257,6 +1257,13 @@ def run_v2( ) -> typing.Iterator[str | None]: raise NotImplementedError + def _render_dropdown_options(self, options: list[str], key: str): + return st.selectbox( + "", + options, + key=key, + ) + def _render_report_button(self): example_id, run_id, uid = extract_query_params(gooey_get_query_params()) # only logged in users can report a run (but not examples/default runs) @@ -1524,6 +1531,7 @@ def _render_after_output(self): st.session_state[StateKeys.pressed_randomize] = True st.experimental_rerun() + self._render_dropdown_options(["Report"], key="--options-dropdown") render_output_caption() def state_to_doc(self, state: dict):