duongthienz commited on
Commit
0233791
·
verified ·
1 Parent(s): 170c898

Fix a bug with conflicted speakers in the same rename

Browse files
Files changed (1) hide show
  1. state.py +2 -1
state.py CHANGED
@@ -277,7 +277,8 @@ def on_grename_change(idx, token_display_map=None):
277
  # Sync widget key as display labels
278
  st.session_state[grkey] = [raw_to_display.get(t, t) for t in entry["speakers"]]
279
 
280
- # Enforce exclusivity and write renames for newly added tokens
 
281
  for token in added:
282
  for other_idx, other_entry in enumerate(st.session_state.globalRenames):
283
  if other_idx == idx:
 
277
  # Sync widget key as display labels
278
  st.session_state[grkey] = [raw_to_display.get(t, t) for t in entry["speakers"]]
279
 
280
+ # Enforce exclusivity: a speaker can only belong to one rename entry at a time.
281
+ # Remove the token from any other entry before writing the new name.
282
  for token in added:
283
  for other_idx, other_entry in enumerate(st.session_state.globalRenames):
284
  if other_idx == idx: