lixuejing commited on
Commit
c54a297
·
1 Parent(s): f9d43be
Files changed (1) hide show
  1. src/submission/submit.py +15 -12
src/submission/submit.py CHANGED
@@ -67,18 +67,21 @@ def add_new_eval(
67
  return styled_error("Could not get your model information. Please fill it up properly.")
68
  print("model_info", model_info)
69
  model_size = get_model_size(model_info=model_info, precision=precision)
70
- else:
71
- model_size = 0
72
 
73
- # Were the model card and license filled?
74
- try:
75
- license = model_info.cardData["license"]
76
- except Exception:
77
- return styled_error("Please select a license for your model")
78
 
79
- modelcard_OK, error_msg = check_model_card(model)
80
- if not modelcard_OK:
81
- return styled_error(error_msg)
 
 
 
 
 
82
 
83
  # Seems good, creating the eval
84
  print("Adding new eval")
@@ -95,9 +98,9 @@ def add_new_eval(
95
  "status": "PENDING",
96
  "submitted_time": current_time,
97
  "model_type": model_type,
98
- "likes": model_info.likes,
99
  "params": model_size,
100
- "license": license,
101
  "private": False,
102
  }
103
 
 
67
  return styled_error("Could not get your model information. Please fill it up properly.")
68
  print("model_info", model_info)
69
  model_size = get_model_size(model_info=model_info, precision=precision)
 
 
70
 
71
+ # Were the model card and license filled?
72
+ try:
73
+ license = model_info.cardData["license"]
74
+ except Exception:
75
+ return styled_error("Please select a license for your model")
76
 
77
+ modelcard_OK, error_msg = check_model_card(model)
78
+ if not modelcard_OK:
79
+ return styled_error(error_msg)
80
+ likes = model_info.likes
81
+ else:
82
+ model_size = 0
83
+ license = ""
84
+ likes = ""
85
 
86
  # Seems good, creating the eval
87
  print("Adding new eval")
 
98
  "status": "PENDING",
99
  "submitted_time": current_time,
100
  "model_type": model_type,
101
+ #"likes": model_info.likes,
102
  "params": model_size,
103
+ #"license": license,
104
  "private": False,
105
  }
106