Hao Xu commited on
Commit
feaf833
·
1 Parent(s): 93fce18

file upload fix

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -150,7 +150,7 @@ def record_submission(benchmark_name, contributor, jsonl_file, hf_path, hf_split
150
  line_count = 0
151
  for line in f:
152
  line_count += 1
153
- if line_count > 10:
154
  break
155
 
156
  try:
@@ -193,7 +193,7 @@ def record_submission(benchmark_name, contributor, jsonl_file, hf_path, hf_split
193
  if has_jsonl:
194
  files['file'] = (benchmark_name.strip() + '.jsonl', open(jsonl_file.name, 'rb'), 'application/json')
195
 
196
- response = requests.post(f"{URL}/", data=data, files=files, timeout=30)
197
 
198
  if files:
199
  files['file'][1].close()
@@ -203,10 +203,7 @@ def record_submission(benchmark_name, contributor, jsonl_file, hf_path, hf_split
203
  if result.get("status") == "success":
204
  message = result.get('message', 'Submission successful!')
205
 
206
- full_message = f"{message}\n\n" \
207
- f"✅ Your submission has been saved and will be processed automatically.\n" \
208
- f"Results will appear in the main leaderboard when ready.\n" \
209
- f"You can refresh the leaderboard to check for updates."
210
 
211
  return full_message
212
  elif result.get("status") == "info":
 
150
  line_count = 0
151
  for line in f:
152
  line_count += 1
153
+ if line_count > 5:
154
  break
155
 
156
  try:
 
193
  if has_jsonl:
194
  files['file'] = (benchmark_name.strip() + '.jsonl', open(jsonl_file.name, 'rb'), 'application/json')
195
 
196
+ response = requests.post(f"{URL}/", data={"payload": json.dumps(data)}, files=files, timeout=30)
197
 
198
  if files:
199
  files['file'][1].close()
 
203
  if result.get("status") == "success":
204
  message = result.get('message', 'Submission successful!')
205
 
206
+ full_message = f"{message}"
 
 
 
207
 
208
  return full_message
209
  elif result.get("status") == "info":