Skip to content

Commit

Permalink
Fixed based on Sean's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
clr-li committed Feb 28, 2024
1 parent 32939ca commit afed0fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions daras_ai_v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1922,23 +1922,23 @@ def render_output_caption():

run_time = st.session_state.get(StateKeys.run_time, 0)
if run_time:
caption += f'Generated in <span style="color: black;">{run_time :.2f}s</span>'
caption += f'Generated in <span style="color: black;">{run_time :.1f}s</span>'

if seed := st.session_state.get("seed"):
caption += f' with seed <span style="color: black;">{seed}</span> '

created_at = st.session_state.get(StateKeys.created_at, datetime.datetime.today())
ended_at = created_at
if created_at:
if isinstance(created_at, str):
created_at = datetime.datetime.fromisoformat(created_at)
caption += " at&nbsp;"
caption += " on&nbsp;"
time_change = datetime.timedelta(seconds=run_time)
ended_at = created_at + time_change

with st.div(className="d-flex"):
st.caption(caption, unsafe_allow_html=True)
js_dynamic_date(
created_at,
date_options={"month": "short", "day": "numeric", "year": "numeric"},
)
js_dynamic_date(created_at, date_options={"month": "short", "day": "numeric"})


def extract_model_fields(
Expand Down
1 change: 0 additions & 1 deletion daras_ai_v2/user_date_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def js_dynamic_date(

def render_js_dynamic_dates():
default_date_options = {
"weekday": "short",
"day": "numeric",
"month": "short",
}
Expand Down

0 comments on commit afed0fd

Please sign in to comment.