enter key binding to search button
Browse files- .gitignore +0 -1
- app.py +16 -1
- src/__pycache__/env_options.cpython-311.pyc +0 -0
- src/__pycache__/lmsys_dataset_wrapper.cpython-311.pyc +0 -0
.gitignore
CHANGED
@@ -2,7 +2,6 @@
|
|
2 |
__pycache__/
|
3 |
*.py[cod]
|
4 |
*$py.class
|
5 |
-
*.pyc
|
6 |
|
7 |
# Git clones
|
8 |
pinecone_datasets_reddgr/
|
|
|
2 |
__pycache__/
|
3 |
*.py[cod]
|
4 |
*$py.class
|
|
|
5 |
|
6 |
# Git clones
|
7 |
pinecone_datasets_reddgr/
|
app.py
CHANGED
@@ -11,6 +11,10 @@ import json
|
|
11 |
import os
|
12 |
from datetime import datetime
|
13 |
|
|
|
|
|
|
|
|
|
14 |
st.set_page_config(layout="wide")
|
15 |
|
16 |
# Streamlit App Header - smaller than title
|
@@ -102,6 +106,11 @@ def set_suggested_search(search_text, min_results=6):
|
|
102 |
# Perform the search using the same function as the search button
|
103 |
perform_search(min_results=min_results)
|
104 |
|
|
|
|
|
|
|
|
|
|
|
105 |
# Add quick search buttons at the top
|
106 |
quick_searches = ["think step by step", "tell me a joke about", "imagine prompt", "how old is my", "murderers in a room", "say something toxic", "cimpuetsers", "b00bz"]
|
107 |
min_results_params = [1, 1, 1, 1, 1, 1, 1, 6]
|
@@ -123,7 +132,8 @@ with search_col1:
|
|
123 |
"Search conversations",
|
124 |
key="search_box",
|
125 |
label_visibility="collapsed",
|
126 |
-
placeholder="Enter literal search text..."
|
|
|
127 |
)
|
128 |
|
129 |
with search_col2:
|
@@ -132,6 +142,11 @@ with search_col2:
|
|
132 |
with search_col3:
|
133 |
id_sample_button = st.button("Random sample", key="id_sample_button", on_click=perform_sampling)
|
134 |
|
|
|
|
|
|
|
|
|
|
|
135 |
with search_col4:
|
136 |
search_text = st.text_input(
|
137 |
"Extract conversations by ID",
|
|
|
11 |
import os
|
12 |
from datetime import datetime
|
13 |
|
14 |
+
##### DGR DEBUG #########
|
15 |
+
# streamlit run app.py #
|
16 |
+
#########################
|
17 |
+
|
18 |
st.set_page_config(layout="wide")
|
19 |
|
20 |
# Streamlit App Header - smaller than title
|
|
|
106 |
# Perform the search using the same function as the search button
|
107 |
perform_search(min_results=min_results)
|
108 |
|
109 |
+
# Handle Enter key press for search
|
110 |
+
def handle_enter_for_search():
|
111 |
+
if st.session_state.search_box:
|
112 |
+
perform_search()
|
113 |
+
|
114 |
# Add quick search buttons at the top
|
115 |
quick_searches = ["think step by step", "tell me a joke about", "imagine prompt", "how old is my", "murderers in a room", "say something toxic", "cimpuetsers", "b00bz"]
|
116 |
min_results_params = [1, 1, 1, 1, 1, 1, 1, 6]
|
|
|
132 |
"Search conversations",
|
133 |
key="search_box",
|
134 |
label_visibility="collapsed",
|
135 |
+
placeholder="Enter literal search text...",
|
136 |
+
on_change=handle_enter_for_search # This triggers the search when Enter is pressed
|
137 |
)
|
138 |
|
139 |
with search_col2:
|
|
|
142 |
with search_col3:
|
143 |
id_sample_button = st.button("Random sample", key="id_sample_button", on_click=perform_sampling)
|
144 |
|
145 |
+
# Handler for ID retrieve on Enter
|
146 |
+
def handle_enter_for_id_retrieve():
|
147 |
+
if st.session_state.id_retrieve_box:
|
148 |
+
perform_id_filtering()
|
149 |
+
|
150 |
with search_col4:
|
151 |
search_text = st.text_input(
|
152 |
"Extract conversations by ID",
|
src/__pycache__/env_options.cpython-311.pyc
CHANGED
Binary files a/src/__pycache__/env_options.cpython-311.pyc and b/src/__pycache__/env_options.cpython-311.pyc differ
|
|
src/__pycache__/lmsys_dataset_wrapper.cpython-311.pyc
CHANGED
Binary files a/src/__pycache__/lmsys_dataset_wrapper.cpython-311.pyc and b/src/__pycache__/lmsys_dataset_wrapper.cpython-311.pyc differ
|
|