Spaces:
Sleeping
Sleeping
LLH
commited on
Commit
·
ed1aac2
1
Parent(s):
32511c8
2024/03/09/18:30
Browse files
app.py
CHANGED
@@ -2002,7 +2002,7 @@ def choose_custom_dataset(file: str):
|
|
2002 |
return get_return(True, {choose_custom_dataset_file: gr.File(Dataset.file, visible=True)})
|
2003 |
|
2004 |
|
2005 |
-
def select_model_optimize_radio(optimize
|
2006 |
optimize = Dataset.get_optimize_name_mapping()[optimize]
|
2007 |
|
2008 |
if optimize == "grid_search":
|
@@ -2015,6 +2015,19 @@ def select_model_optimize_radio(optimize="无"):
|
|
2015 |
return get_return(True)
|
2016 |
|
2017 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018 |
def linear_regression_model_radio_change(model):
|
2019 |
if model:
|
2020 |
Dataset.linear_regression_model_type = Dataset.get_linear_regression_model_name_mapping()[model]
|
@@ -2432,13 +2445,16 @@ with gr.Blocks(js="./design/welcome.js", css="./design/custom.css") as demo:
|
|
2432 |
)
|
2433 |
|
2434 |
# 数据模型
|
|
|
2435 |
select_as_model_radio.change(
|
2436 |
fn=select_as_model,
|
2437 |
inputs=[select_as_model_radio],
|
2438 |
outputs=get_outputs()
|
2439 |
).then(
|
2440 |
-
fn=
|
2441 |
-
|
|
|
|
|
2442 |
outputs=get_outputs()
|
2443 |
)
|
2444 |
|
|
|
2002 |
return get_return(True, {choose_custom_dataset_file: gr.File(Dataset.file, visible=True)})
|
2003 |
|
2004 |
|
2005 |
+
def select_model_optimize_radio(optimize):
|
2006 |
optimize = Dataset.get_optimize_name_mapping()[optimize]
|
2007 |
|
2008 |
if optimize == "grid_search":
|
|
|
2015 |
return get_return(True)
|
2016 |
|
2017 |
|
2018 |
+
def reset_select_model_optimize_radio_part_1():
|
2019 |
+
Dataset.choose_optimize = "None"
|
2020 |
+
|
2021 |
+
return get_return(True)
|
2022 |
+
|
2023 |
+
|
2024 |
+
def reset_select_model_optimize_radio_part_2():
|
2025 |
+
# TODO: 默认只有“网格搜索”
|
2026 |
+
Dataset.choose_optimize = "bayes_search"
|
2027 |
+
|
2028 |
+
return get_return(True)
|
2029 |
+
|
2030 |
+
|
2031 |
def linear_regression_model_radio_change(model):
|
2032 |
if model:
|
2033 |
Dataset.linear_regression_model_type = Dataset.get_linear_regression_model_name_mapping()[model]
|
|
|
2445 |
)
|
2446 |
|
2447 |
# 数据模型
|
2448 |
+
# TODO: 有BUG
|
2449 |
select_as_model_radio.change(
|
2450 |
fn=select_as_model,
|
2451 |
inputs=[select_as_model_radio],
|
2452 |
outputs=get_outputs()
|
2453 |
).then(
|
2454 |
+
fn=reset_select_model_optimize_radio_part_1(),
|
2455 |
+
outputs=get_outputs()
|
2456 |
+
).then(
|
2457 |
+
fn=reset_select_model_optimize_radio_part_2(),
|
2458 |
outputs=get_outputs()
|
2459 |
)
|
2460 |
|