Spaces:
Sleeping
Sleeping
change pd append to pd concat
Browse files- pages/Ranking.py +4 -2
pages/Ranking.py
CHANGED
@@ -119,7 +119,7 @@ class RankingApp:
|
|
119 |
prompt_tags, tag, prompt_id, items = self.sidebar()
|
120 |
batch_num = len(items) // self.batch_size
|
121 |
batch_num += 1 if len(items) % self.batch_size != 0 else 0
|
122 |
-
|
123 |
st.session_state.counter[prompt_id] = 0 if prompt_id not in st.session_state.counter else st.session_state.counter[prompt_id]
|
124 |
|
125 |
# save prompt_id in session state
|
@@ -223,7 +223,9 @@ if __name__ == "__main__":
|
|
223 |
# only select the part of the promptbook where tag is the same as st.session_state.selected_dict.keys(), while model version ids are the same as corresponding values to each key
|
224 |
promptBook_selected = pd.DataFrame()
|
225 |
for key, value in st.session_state.selected_dict.items():
|
226 |
-
promptBook_selected = promptBook_selected.append(promptBook[(promptBook['prompt_id'] == key) & (promptBook['modelVersion_id'].isin(value))])
|
|
|
|
|
227 |
promptBook_selected = promptBook_selected.reset_index(drop=True)
|
228 |
# st.write(promptBook_selected)
|
229 |
images_endpoint = "https://modelcofferbucket.s3-accelerate.amazonaws.com/"
|
|
|
119 |
prompt_tags, tag, prompt_id, items = self.sidebar()
|
120 |
batch_num = len(items) // self.batch_size
|
121 |
batch_num += 1 if len(items) % self.batch_size != 0 else 0
|
122 |
+
|
123 |
st.session_state.counter[prompt_id] = 0 if prompt_id not in st.session_state.counter else st.session_state.counter[prompt_id]
|
124 |
|
125 |
# save prompt_id in session state
|
|
|
223 |
# only select the part of the promptbook where tag is the same as st.session_state.selected_dict.keys(), while model version ids are the same as corresponding values to each key
|
224 |
promptBook_selected = pd.DataFrame()
|
225 |
for key, value in st.session_state.selected_dict.items():
|
226 |
+
# promptBook_selected = promptBook_selected.append(promptBook[(promptBook['prompt_id'] == key) & (promptBook['modelVersion_id'].isin(value))])
|
227 |
+
# replace append with pd.concat
|
228 |
+
promptBook_selected = pd.concat([promptBook_selected, promptBook[(promptBook['prompt_id'] == key) & (promptBook['modelVersion_id'].isin(value))]])
|
229 |
promptBook_selected = promptBook_selected.reset_index(drop=True)
|
230 |
# st.write(promptBook_selected)
|
231 |
images_endpoint = "https://modelcofferbucket.s3-accelerate.amazonaws.com/"
|