Wendy commited on
Commit
f9d46da
·
verified ·
1 Parent(s): d2468c2

Upload cogagent_infer_batch.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. cogagent_infer_batch.py +4 -3
cogagent_infer_batch.py CHANGED
@@ -13,8 +13,7 @@ class AITM_Dataset(Dataset):
13
  def __init__(self, json_path):
14
  self.data = []
15
  with open(json_path, 'r') as f:
16
- for line in f:
17
- self.data.append(json.loads(line))
18
 
19
  def __len__(self):
20
  return len(self.data)
@@ -219,10 +218,12 @@ def main():
219
  }
220
  res.append(ans)
221
  round_num += 1
222
- print(res)
 
223
  with open(args.output_json, "w") as file:
224
  print("Writing to json file")
225
  json.dump(res, file, indent=4)
 
226
 
227
 
228
 
 
13
  def __init__(self, json_path):
14
  self.data = []
15
  with open(json_path, 'r') as f:
16
+ self.data.append(json.loads(line))
 
17
 
18
  def __len__(self):
19
  return len(self.data)
 
218
  }
219
  res.append(ans)
220
  round_num += 1
221
+ #print(res)
222
+ print("Writing to json file")
223
  with open(args.output_json, "w") as file:
224
  print("Writing to json file")
225
  json.dump(res, file, indent=4)
226
+ print("Done")
227
 
228
 
229