Thun09 commited on
Commit
c36f3d8
·
1 Parent(s): 161ad85

Update space

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. utils.py +5 -0
app.py CHANGED
@@ -91,6 +91,6 @@ logging.basicConfig()
91
  logging.getLogger('apscheduler').setLevel(logging.DEBUG)
92
 
93
  scheduler = BackgroundScheduler()
94
- scheduler.add_job(restart_space, "interval", seconds=3600)
95
  scheduler.start()
96
  demo.queue(default_concurrency_limit=40).launch()
 
91
  logging.getLogger('apscheduler').setLevel(logging.DEBUG)
92
 
93
  scheduler = BackgroundScheduler()
94
+ scheduler.add_job(restart_space, "interval", seconds=300)
95
  scheduler.start()
96
  demo.queue(default_concurrency_limit=40).launch()
utils.py CHANGED
@@ -132,6 +132,11 @@ def check_json_file(json_file):
132
  data = json.load(f)
133
  except json.JSONDecodeError:
134
  return False, "JSON file is not valid JSON."
 
 
 
 
 
135
  # 检查dimensions键是否存在且是否存在对应的值('Audience', 'Keyword', 'Format', 'Language', 'Length', 'Source')
136
  if "dimensions" not in data:
137
  return False, "JSON file does not contain 'dimensions' key.",
 
132
  data = json.load(f)
133
  except json.JSONDecodeError:
134
  return False, "JSON file is not valid JSON."
135
+
136
+ # 检查Model是否已在temp文件夹中
137
+ submission_queue_df = get_submission_data()
138
+ if any([data["Model"] in row["Model"] for _, row in submission_queue_df.iterrows()]):
139
+ return False, "Model already in submission queue."
140
  # 检查dimensions键是否存在且是否存在对应的值('Audience', 'Keyword', 'Format', 'Language', 'Length', 'Source')
141
  if "dimensions" not in data:
142
  return False, "JSON file does not contain 'dimensions' key.",