Clémentine commited on
Commit
a4c11b8
1 Parent(s): 5cca94b

should fix the problem with flagsrm create_request_file.py

Browse files
src/submission/check_validity.py CHANGED
@@ -60,9 +60,10 @@ def is_model_on_hub(model_name: str, revision: str, token: str = None, trust_rem
60
  )
61
 
62
  except Exception as e:
 
 
63
  return False, "was not found on hub!", None
64
 
65
-
66
  def get_model_size(model_info: ModelInfo, precision: str):
67
  size_pattern = re.compile(r"(\d+\.)?\d+(b|m)")
68
  safetensors = None
 
60
  )
61
 
62
  except Exception as e:
63
+ if "You are trying to access a gated repo." in str(e):
64
+ return True, "uses a gated model.", None
65
  return False, "was not found on hub!", None
66
 
 
67
  def get_model_size(model_info: ModelInfo, precision: str):
68
  size_pattern = re.compile(r"(\d+\.)?\d+(b|m)")
69
  safetensors = None
src/submission/submit.py CHANGED
@@ -72,7 +72,7 @@ def add_new_eval(
72
  created_at = ""
73
  if not weight_type == "Adapter":
74
  model_on_hub, error, model_config = is_model_on_hub(model_name=model, revision=revision, test_tokenizer=True)
75
- if not model_on_hub:
76
  return styled_error(f'Model "{model}" {error}')
77
  if model_config is not None:
78
  architectures = getattr(model_config, "architectures", None)
 
72
  created_at = ""
73
  if not weight_type == "Adapter":
74
  model_on_hub, error, model_config = is_model_on_hub(model_name=model, revision=revision, test_tokenizer=True)
75
+ if not model_on_hub or model_config is None:
76
  return styled_error(f'Model "{model}" {error}')
77
  if model_config is not None:
78
  architectures = getattr(model_config, "architectures", None)