inoki-giskard ZeroCommand commited on
Commit
02f1357
1 Parent(s): beb62dc

clean code - remove print command (#33)

Browse files

- Update text_classification_ui_helpers.py (717364adca244939bee495ec6a3aabd8e5e8e7ee)
- hot fix labels doublw list (0d92a0d44b9808ae01e0606ff6553a3070d06979)
- hot fix inference api token arg name (b037e5e81e82d15bf00e31fc3412701ebbf29c75)


Co-authored-by: zcy <ZeroCommand@users.noreply.huggingface.co>

text_classification.py CHANGED
@@ -24,7 +24,7 @@ def get_labels_and_features_from_dataset(dataset_id, dataset_config, split):
24
  label_feat = dataset_features[label_keys[0]].feature
25
  labels = label_feat.names
26
  else:
27
- labels = [dataset_features[label_keys[0]].names]
28
  features = [f for f in dataset_features.keys() if not f.startswith("label")]
29
  return labels, features
30
  except Exception as e:
 
24
  label_feat = dataset_features[label_keys[0]].feature
25
  labels = label_feat.names
26
  else:
27
+ labels = dataset_features[label_keys[0]].names
28
  features = [f for f in dataset_features.keys() if not f.startswith("label")]
29
  return labels, features
30
  except Exception as e:
text_classification_ui_helpers.py CHANGED
@@ -297,7 +297,7 @@ def try_submit(m_id, d_id, config, split, local, inference, inference_token, uid
297
  leaderboard_dataset,
298
  "--inference_type",
299
  inference_type,
300
- "--inference_token",
301
  inference_token,
302
  ]
303
  if os.environ.get(HF_GSK_HUB_KEY):
@@ -319,7 +319,7 @@ def try_submit(m_id, d_id, config, split, local, inference, inference_token, uid
319
  eval_str = f"[{m_id}]<{d_id}({config}, {split} set)>"
320
  logging.info(f"Start local evaluation on {eval_str}")
321
  save_job_to_pipe(uid, command, eval_str, threading.Lock())
322
- print(command)
323
  write_log_to_user_file(
324
  uid,
325
  f"Start local evaluation on {eval_str}. Please wait for your job to start...\n",
 
297
  leaderboard_dataset,
298
  "--inference_type",
299
  inference_type,
300
+ "--inference_api_token",
301
  inference_token,
302
  ]
303
  if os.environ.get(HF_GSK_HUB_KEY):
 
319
  eval_str = f"[{m_id}]<{d_id}({config}, {split} set)>"
320
  logging.info(f"Start local evaluation on {eval_str}")
321
  save_job_to_pipe(uid, command, eval_str, threading.Lock())
322
+
323
  write_log_to_user_file(
324
  uid,
325
  f"Start local evaluation on {eval_str}. Please wait for your job to start...\n",