weiminhu commited on
Commit
f22bb00
·
verified ·
1 Parent(s): 4f84a5c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -1
README.md CHANGED
@@ -294,7 +294,14 @@ from datasets import load_dataset
294
  dataset = load_dataset("weiminhu/D-MIPLIB","CA-easy", split='test')
295
  test_id = 0
296
  test_instance = dataset[test_id]['MILP']
297
- ins_save_path = "./test_instance_%s.lp" % test_id
 
 
 
 
 
 
 
298
  with open(ins_save_path, "w") as file:
299
  tmp=test_instance[2:-1]
300
  tmp=tmp.replace("\\n","\n")
 
294
  dataset = load_dataset("weiminhu/D-MIPLIB","CA-easy", split='test')
295
  test_id = 0
296
  test_instance = dataset[test_id]['MILP']
297
+
298
+ # check file format
299
+ file_format='lp'
300
+ if 'format' in list(dataset[0].keys()):
301
+ if dataset[0]['format']=='mps':
302
+ file_format='mps'
303
+ ins_save_path = "./test_instance_%s.%s" % (test_id,file_format)
304
+ # write file to disk
305
  with open(ins_save_path, "w") as file:
306
  tmp=test_instance[2:-1]
307
  tmp=tmp.replace("\\n","\n")