hysts commited on
Commit
f1c8dac
1 Parent(s): 643c51e

Check required fields first

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -88,12 +88,16 @@ def save_space_info(dirname: str, filename: str, content: str) -> None:
88
 
89
  def run(space_name: str, model_names_str: str, hf_token: str, title: str,
90
  description: str, article: str) -> str:
 
 
 
 
 
 
 
91
  model_names = [name.strip() for name in model_names_str.split(',')]
92
  model_names_str = '\n'.join(model_names)
93
 
94
- if len(model_names) == 0:
95
- return 'Model Name cannot be empty.'
96
-
97
  missing_models = [
98
  name for name in model_names if not check_if_model_exists(name)
99
  ]
 
88
 
89
  def run(space_name: str, model_names_str: str, hf_token: str, title: str,
90
  description: str, article: str) -> str:
91
+ if space_name == '':
92
+ return 'Space Name must be specified.'
93
+ if model_names_str == '':
94
+ return 'Model Names must be specified.'
95
+ if hf_token == '':
96
+ return 'Hugging Face Token must be specified.'
97
+
98
  model_names = [name.strip() for name in model_names_str.split(',')]
99
  model_names_str = '\n'.join(model_names)
100
 
 
 
 
101
  missing_models = [
102
  name for name in model_names if not check_if_model_exists(name)
103
  ]