Hey everyone. I’m working on building a human-in-the-loop app. What I’ve got is several sound files that I’d like a human to be able to go in and click yes or no on to determine if the sound file contains the correctly predicted sound. I’ve been trying to put this into a loop. When I do this, I keep running into this error:
DuplicateWidgetID: There are multiple identical st.selectbox widgets with the same generated key.
(When a widget is created, it’s assigned an internal key based on its structure. Multiple widgets with an identical structure will result in the same internal key, which causes this error.)
To fix this, please pass a unique key argument to st.selectbox.
Essentially what I’m doing is:
Def music(input_location): Outfile = open(input_location, 'rb') Data = oufile.read() St.audio(data, format = 'audio/m4a') Option = st.selectbox('Did you hear a voice?', ('Yes', 'No')) import glob file_location = os.path.join('my path', '*.m4a') filenames = glob.glob(file_location) For I in range(len(filenames)): Music(filenames[i])
Any ideas on how to get around this error besides manually renaming the variable?