test
Browse files
app.py
CHANGED
@@ -218,10 +218,17 @@ def show_results_tab(df):
|
|
218 |
show_copy_button=True # 添加复制按钮使其更方便使用
|
219 |
)
|
220 |
|
|
|
|
|
|
|
|
|
221 |
|
222 |
def show_predictions_tab(model_list, dataset_list, predictions):
|
223 |
|
224 |
def get_pre_df(model_name, dataset_name):
|
|
|
|
|
|
|
225 |
this_predictions = predictions[dataset_name][model_name]['predictions']
|
226 |
for i in range(len(this_predictions)):
|
227 |
this_predictions[i]['origin_prompt'] = str(this_predictions[i]['origin_prompt'])
|
|
|
218 |
show_copy_button=True # 添加复制按钮使其更方便使用
|
219 |
)
|
220 |
|
221 |
+
ERROR_DF = {
|
222 |
+
"Type": ['NoneType'],
|
223 |
+
"Details": ["Do not find the combination predictions of the two options above."]
|
224 |
+
}
|
225 |
|
226 |
def show_predictions_tab(model_list, dataset_list, predictions):
|
227 |
|
228 |
def get_pre_df(model_name, dataset_name):
|
229 |
+
if dataset_name not in predictions.keys() or model_name not in predictions[dataset_name].keys():
|
230 |
+
return pd.DataFrame(ERROR_DF)
|
231 |
+
|
232 |
this_predictions = predictions[dataset_name][model_name]['predictions']
|
233 |
for i in range(len(this_predictions)):
|
234 |
this_predictions[i]['origin_prompt'] = str(this_predictions[i]['origin_prompt'])
|