Spaces:
Sleeping
Sleeping
Preference-Dissection
commited on
Commit
•
aa488d1
1
Parent(s):
28928f8
Update app.py
Browse files
app.py
CHANGED
@@ -445,7 +445,6 @@ def display_markdown_with_scroll(text, height=200):
|
|
445 |
text (str): The Markdown text to be displayed.
|
446 |
height (int): Height of the scrollable area in pixels.
|
447 |
"""
|
448 |
-
# 使用 <pre> 标签来包裹 Markdown 内容,并添加 CSS 样式创建可滚动的区域
|
449 |
markdown_container = f"""
|
450 |
<pre style="
|
451 |
overflow-y: scroll;
|
@@ -473,9 +472,7 @@ def compute_one_model_fitted_params(filename, num_fold, query_aware_idxs, resolv
|
|
473 |
|
474 |
for part in list(query_aware_idxs.keys()):
|
475 |
if part == "all": continue
|
476 |
-
# 使用 st.empty 创建占位符
|
477 |
progress_text = st.empty()
|
478 |
-
# if part not in ["Advice","NLP Tasks"]:continue
|
479 |
progress_text.write(f"{ccount+1}/{len(list(query_aware_idxs.keys()))-1} "+formal_group_name(part))
|
480 |
progress_bar = st.progress(0)
|
481 |
cared_idxs = query_aware_idxs.get(part)
|
@@ -528,7 +525,6 @@ def compute_one_model_fitted_params(filename, num_fold, query_aware_idxs, resolv
|
|
528 |
parameters = final_paras.tolist()
|
529 |
one_model_fitted_params[formal_group_name(part)] = parameters
|
530 |
|
531 |
-
# 函数处理完毕,清除进度条和文本
|
532 |
progress_text.empty()
|
533 |
progress_bar.empty()
|
534 |
ccount+=1
|
@@ -536,7 +532,6 @@ def compute_one_model_fitted_params(filename, num_fold, query_aware_idxs, resolv
|
|
536 |
return one_model_fitted_params
|
537 |
|
538 |
def get_json_download_link(json_str, file_name, button_text):
|
539 |
-
# 创建一个BytesIO对象
|
540 |
b64 = base64.b64encode(json_str.encode()).decode()
|
541 |
href = f'<a href="data:file/json;base64,{b64}" download="{file_name}">{button_text}</a>'
|
542 |
return href
|
@@ -776,7 +771,7 @@ This analysis is based on:
|
|
776 |
"> *f(x) > 0.5 means response A is preferred more, and vice versa.*"
|
777 |
)
|
778 |
st.markdown(
|
779 |
-
"> *Property = 1 means response A
|
780 |
)
|
781 |
|
782 |
# count how mant nonzero in shape_values[0].data
|
|
|
445 |
text (str): The Markdown text to be displayed.
|
446 |
height (int): Height of the scrollable area in pixels.
|
447 |
"""
|
|
|
448 |
markdown_container = f"""
|
449 |
<pre style="
|
450 |
overflow-y: scroll;
|
|
|
472 |
|
473 |
for part in list(query_aware_idxs.keys()):
|
474 |
if part == "all": continue
|
|
|
475 |
progress_text = st.empty()
|
|
|
476 |
progress_text.write(f"{ccount+1}/{len(list(query_aware_idxs.keys()))-1} "+formal_group_name(part))
|
477 |
progress_bar = st.progress(0)
|
478 |
cared_idxs = query_aware_idxs.get(part)
|
|
|
525 |
parameters = final_paras.tolist()
|
526 |
one_model_fitted_params[formal_group_name(part)] = parameters
|
527 |
|
|
|
528 |
progress_text.empty()
|
529 |
progress_bar.empty()
|
530 |
ccount+=1
|
|
|
532 |
return one_model_fitted_params
|
533 |
|
534 |
def get_json_download_link(json_str, file_name, button_text):
|
|
|
535 |
b64 = base64.b64encode(json_str.encode()).decode()
|
536 |
href = f'<a href="data:file/json;base64,{b64}" download="{file_name}">{button_text}</a>'
|
537 |
return href
|
|
|
771 |
"> *f(x) > 0.5 means response A is preferred more, and vice versa.*"
|
772 |
)
|
773 |
st.markdown(
|
774 |
+
"> *Property = 1 means response A satisfies the property better than B, and vice versa. We only show the properties that distinguish A and B.*"
|
775 |
)
|
776 |
|
777 |
# count how mant nonzero in shape_values[0].data
|