lewtun HF staff commited on
Commit
de92d49
1 Parent(s): 9e9142d

Pass token to metadata getter

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. utils.py +2 -2
app.py CHANGED
@@ -165,7 +165,7 @@ if is_valid_dataset["valid"] is False:
165
  [discussion](https://huggingface.co/spaces/autoevaluate/model-evaluator/discussions) for support."""
166
  )
167
 
168
- metadata = get_metadata(selected_dataset)
169
  print(f"INFO -- Dataset metadata: {metadata}")
170
  if metadata is None:
171
  st.warning("No evaluation metadata found. Please configure the evaluation job below.")
 
165
  [discussion](https://huggingface.co/spaces/autoevaluate/model-evaluator/discussions) for support."""
166
  )
167
 
168
+ metadata = get_metadata(selected_dataset, token=HF_TOKEN)
169
  print(f"INFO -- Dataset metadata: {metadata}")
170
  if metadata is None:
171
  st.warning("No evaluation metadata found. Please configure the evaluation job below.")
utils.py CHANGED
@@ -59,8 +59,8 @@ def http_get(path: str, domain: str, token: str = None, params: dict = None) ->
59
  return response
60
 
61
 
62
- def get_metadata(dataset_name: str) -> Union[Dict, None]:
63
- data = dataset_info(dataset_name)
64
  if data.cardData is not None and "train-eval-index" in data.cardData.keys():
65
  return data.cardData["train-eval-index"]
66
  else:
 
59
  return response
60
 
61
 
62
+ def get_metadata(dataset_name: str, token: str) -> Union[Dict, None]:
63
+ data = dataset_info(dataset_name, token=token)
64
  if data.cardData is not None and "train-eval-index" in data.cardData.keys():
65
  return data.cardData["train-eval-index"]
66
  else: