Spaces:
Restarting
Restarting
Commit
Β·
308cfba
1
Parent(s):
aa8b25c
fix not downloading the metadata
Browse files- mnz_sample_submission.jsonl +2 -0
- src/eval.py +8 -0
mnz_sample_submission.jsonl
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
{"id": "csplib__csplib_001_car_sequencing","model": "%% Data\narray[1..5] of int: at_most = [1, 2, 2, 2, 1];\narray[1..5] of int: per_slots = [2, 3, 3, 5, 5];\narray[1..6] of int: demand = [1, 1, 2, 2, 2, 2];\narray[1..6, 1..5] of int: requires = \n [|1, 0, 1, 1, 0|\n 0, 0, 0, 1, 0|\n 0, 1, 0, 0, 1|\n 0, 1, 0, 1, 0|\n 1, 0, 1, 0, 0|\n 1, 1, 0, 0, 0|];\n\nint: n_types = 6;\nint: n_options = 5;\nint: n_cars = sum(demand);\nset of int: Cars = 1..n_cars;\nset of int: Options = 1..n_options;\nset of int: Types = 1..n_types;\n\n%% Decision variables\narray[Cars] of var Types: sequence;\narray[Cars, Options] of var bool: setup;\n\n%% Constraints\nconstraint\n forall(t in Types) (\n count(sequence, t) = demand[t]\n );\n\nconstraint\n forall(c in Cars, o in Options) (\n setup[c, o] = requires[sequence[c], o]\n );\n\nconstraint\n forall(o in Options) (\n forall(s in 1..n_cars - per_slots[o] + 1) (\n sum(i in s..s + per_slots[o] - 1)(bool2int(setup[i, o])) <= at_most[o]\n )\n );\n\nsolve satisfy;\n\noutput [\n \"{ \\\"sequence\\\": \", show([sequence[c] - 1 | c in Cars]), \" }\"\n];"}
|
2 |
+
{"id": "csplib__csplib_002_template_design","model": "%% Data\nint: n_slots = 9;\nint: n_templates = 2;\nint: n_var = 7;\narray[1..n_var] of int: demand = [250, 255, 260, 500, 500, 800, 1100];\nint: ub = max(demand);\n\n%% Sets\nset of int: Templates = 1..n_templates;\nset of int: Variations = 1..n_var;\n\n%% Decision variables\narray[Templates] of var 1..ub: production;\narray[Templates, Variations] of var 0..n_slots: layout;\n\n%% Constraints\nconstraint\n forall(t in Templates) (\n sum(v in Variations)(layout[t, v]) = n_slots\n );\n\nconstraint\n forall(v in Variations) (\n sum(t in Templates)(production[t] * layout[t, v]) >= demand[v]\n );\n\n%% Break symmetry for equal demand\nconstraint\n forall(i in 1..n_var-1 where demand[i] == demand[i+1]) (\n layout[1, i] <= layout[1, i+1] /\\\n forall(t in 1..n_templates-1)(\n (layout[t, i] = layout[t, i+1]) -> (layout[t+1, i] <= layout[t+1, i+1])\n )\n );\n\n%% Distinguish templates\nconstraint\n forall(i in 1..n_templates-1)(production[i] <= production[i+1]);\n\n%% Static symmetry for increasing demand\nconstraint\n forall(i in 1..n_var-1 where demand[i] < demand[i+1]) (\n sum(t in Templates)(production[t] * layout[t, i]) <= sum(t in Templates)(production[t] * layout[t, i+1])\n );\n\n%% Objective\nsolve minimize sum(t in Templates)(production[t]);\n\n%% Output\noutput [\n \"{ \\\"production\\\": \", show([production[t] | t in Templates]), \", \\\"layout\\\": \", show([ [layout[t,v] | v in Variations] | t in Templates ]), \" }\"\n];"}
|
src/eval.py
CHANGED
@@ -295,6 +295,14 @@ def main(
|
|
295 |
filename=f"{submission_path_in_dataset}/submission.jsonl",
|
296 |
)
|
297 |
print(f" Downloaded submission file successfully.", flush=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
|
299 |
except Exception as e_download:
|
300 |
print(f" CRITICAL ERROR - Failed to download submission files: {e_download}", flush=True)
|
|
|
295 |
filename=f"{submission_path_in_dataset}/submission.jsonl",
|
296 |
)
|
297 |
print(f" Downloaded submission file successfully.", flush=True)
|
298 |
+
# Download the metadata file
|
299 |
+
hf_hub_download(
|
300 |
+
repo_id=user_dataset_repo_id,
|
301 |
+
repo_type="dataset",
|
302 |
+
local_dir=local_submission_dir,
|
303 |
+
filename=f"{submission_path_in_dataset}/metadata.json",
|
304 |
+
)
|
305 |
+
print(f" Downloaded metadata file successfully.", flush=True)
|
306 |
|
307 |
except Exception as e_download:
|
308 |
print(f" CRITICAL ERROR - Failed to download submission files: {e_download}", flush=True)
|