Hi all,
I was trying to make a streamlit web page to get a feedback from users
for some number of texts.
However, using st.feedback(“thumbs”) more than once in a page gives me an error of this:
StreamlitDuplicateElementId: There are multiple
button_group
elements with the same auto-generated ID. When this element is created, it is assigned an internal ID based on the element type and provided parameters. Multiple elements with the same type and parameters will cause this error.To fix this error, please pass a unique
key
argument to thebutton_group
element.
Does any body know how to solve this issue?
I’m attaching the example code that I try for this app below.
import streamlit as st
for text number one
sentiment_mapping = [“:material/thumb_down:”, “:material/thumb_up:”]
selected = st.feedback(“thumbs”)
if selected is not None:
st.markdown(f"You selected: {sentiment_mapping[selected]}")
for text number two
sentiment_mapping = [“:material/thumb_down:”, “:material/thumb_up:”]
selected = st.feedback(“thumbs”)
if selected is not None:
st.markdown(f"You selected: {sentiment_mapping[selected]}")
for text number three
sentiment_mapping = [“:material/thumb_down:”, “:material/thumb_up:”]
selected = st.feedback(“thumbs”)
if selected is not None:
st.markdown(f"You selected: {sentiment_mapping[selected]}")