Skip to content

Commit

Permalink
simplify non-canonical logic
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderGi committed Dec 14, 2023
1 parent 792aa92 commit a504404
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions daras_ai_v2/asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,8 @@ def asr_language_selector(
# handle non-canonical language codes
old_val = ConsistentLanguageCode(st.session_state.get(key))
if old_val and str(old_val) not in options and old_val in options:
new_val = options.pop(options.index(old_val))
st.session_state[key] = new_val
options.insert(0, new_val)
st.session_state[key] = options.pop(options.index(old_val))
options.insert(0, st.session_state[key])

return st.selectbox(
label=label,
Expand Down

0 comments on commit a504404

Please sign in to comment.