Spaces:
Runtime error
Runtime error
Commit
·
45c093d
1
Parent(s):
5bffde4
Update app.py
Browse files
app.py
CHANGED
@@ -15,15 +15,6 @@ st.set_page_config(page_title="PSC Runtime",
|
|
15 |
page_icon='🌸', layout="centered")
|
16 |
|
17 |
|
18 |
-
col1, col2 = st.columns([9, 1])
|
19 |
-
with col1:
|
20 |
-
search_query = st.text_input(label="search query", placeholder="Search")
|
21 |
-
|
22 |
-
with col2:
|
23 |
-
st.write('#')
|
24 |
-
button_clicked = st.button("🔎")
|
25 |
-
|
26 |
-
|
27 |
import torch
|
28 |
fn = "dl19-gpt-3.5.pt"
|
29 |
object = torch.load(fn)
|
@@ -37,10 +28,12 @@ for output in outputs:
|
|
37 |
query = list(all_queries)[0]
|
38 |
query2outputs[query] = [x['hits'] for x in output]
|
39 |
|
40 |
-
|
41 |
search_query = st.selectbox(
|
42 |
-
"
|
43 |
-
sorted(query2outputs)
|
|
|
|
|
44 |
)
|
45 |
|
46 |
def preferences_from_hits(list_of_hits):
|
@@ -91,8 +84,8 @@ def aggregate(list_of_hits):
|
|
91 |
|
92 |
|
93 |
def write_ranking(search_results):
|
94 |
-
st.write(
|
95 |
-
|
96 |
|
97 |
qid = {result["qid"] for result in search_results}
|
98 |
assert len(qid) == 1
|
|
|
15 |
page_icon='🌸', layout="centered")
|
16 |
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
import torch
|
19 |
fn = "dl19-gpt-3.5.pt"
|
20 |
object = torch.load(fn)
|
|
|
28 |
query = list(all_queries)[0]
|
29 |
query2outputs[query] = [x['hits'] for x in output]
|
30 |
|
31 |
+
|
32 |
search_query = st.selectbox(
|
33 |
+
"",
|
34 |
+
sorted(query2outputs),
|
35 |
+
index=None,
|
36 |
+
placeholder="Choose a query from the list..."
|
37 |
)
|
38 |
|
39 |
def preferences_from_hits(list_of_hits):
|
|
|
84 |
|
85 |
|
86 |
def write_ranking(search_results):
|
87 |
+
# st.write(
|
88 |
+
# f'<p align=\"right\" style=\"color:grey;\"> Before aggregation for query [{search_query}] ms</p>', unsafe_allow_html=True)
|
89 |
|
90 |
qid = {result["qid"] for result in search_results}
|
91 |
assert len(qid) == 1
|