Allow submitting models with remote code

#58
by tju01 - opened
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -9,7 +9,7 @@ import pandas as pd
9
  from apscheduler.schedulers.background import BackgroundScheduler
10
  from content import *
11
  from huggingface_hub import Repository, HfApi
12
- from transformers import AutoConfig
13
  from utils import get_eval_results_dicts, make_clickable_model
14
 
15
  # clone / pull the lmeh eval data
@@ -224,7 +224,7 @@ leaderboard_df = original_df.copy()
224
 
225
  def is_model_on_hub(model_name, revision) -> bool:
226
  try:
227
- config = AutoConfig.from_pretrained(model_name, revision=revision)
228
  return True
229
 
230
  except Exception as e:
 
9
  from apscheduler.schedulers.background import BackgroundScheduler
10
  from content import *
11
  from huggingface_hub import Repository, HfApi
12
+ from transformers import PretrainedConfig
13
  from utils import get_eval_results_dicts, make_clickable_model
14
 
15
  # clone / pull the lmeh eval data
 
224
 
225
  def is_model_on_hub(model_name, revision) -> bool:
226
  try:
227
+ config = PretrainedConfig.get_config_dict(model_name, revision=revision)
228
  return True
229
 
230
  except Exception as e: