ynhe commited on
Commit
88a5dbb
·
verified ·
1 Parent(s): f5188ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -460,8 +460,8 @@ def get_all_df_quality(selected_columns, dir=QUALITY_DIR):
460
  return df
461
 
462
  def get_all_df_i2v(selected_columns, dir=I2V_DIR):
463
- # submission_repo = Repository(local_dir=SUBMISSION_NAME, clone_from=SUBMISSION_URL, use_auth_token=HF_TOKEN, repo_type="dataset")
464
- # submission_repo.git_pull()
465
  df = pd.read_csv(dir)
466
  df = get_final_score_i2v(df, selected_columns)
467
  df = df.sort_values(by="Selected Score", ascending=False)
@@ -486,10 +486,12 @@ def convert_scores_to_percentage(df):
486
  for column in df.columns[skip_col:]: # 假设第一列是'name'
487
  # if df[column].isdigit():
488
  # print(df[column])
489
- is_numeric = pd.to_numeric(df[column], errors='coerce').notna().all()
490
- if is_numeric:
 
491
  df[column] = round(df[column] * 100,2)
492
- df[column] = df[column].apply(lambda x: f"{x:05.2f}") + '%'
 
493
  return df
494
 
495
  def choose_all_quailty():
 
460
  return df
461
 
462
  def get_all_df_i2v(selected_columns, dir=I2V_DIR):
463
+ submission_repo = Repository(local_dir=SUBMISSION_NAME, clone_from=SUBMISSION_URL, use_auth_token=HF_TOKEN, repo_type="dataset")
464
+ submission_repo.git_pull()
465
  df = pd.read_csv(dir)
466
  df = get_final_score_i2v(df, selected_columns)
467
  df = df.sort_values(by="Selected Score", ascending=False)
 
486
  for column in df.columns[skip_col:]: # 假设第一列是'name'
487
  # if df[column].isdigit():
488
  # print(df[column])
489
+ # is_numeric = pd.to_numeric(df[column], errors='coerce').notna().all()
490
+ valid_numeric_count = pd.to_numeric(df[column], errors='coerce').notna().sum()
491
+ if valid_numeric_count > 0:
492
  df[column] = round(df[column] * 100,2)
493
+ df['column'] = df['column'].apply(lambda x: f"{x:05.2f}%" if pd.notna(x) else x)
494
+ # df[column] = df[column].apply(lambda x: f"{x:05.2f}") + '%'
495
  return df
496
 
497
  def choose_all_quailty():