Wendy-Fly commited on
Commit
742d853
·
verified ·
1 Parent(s): f7cf814

Upload generate_prompt.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. generate_prompt.py +6 -2
generate_prompt.py CHANGED
@@ -55,6 +55,9 @@ correct_num = 0
55
  begin = args.begin
56
  end = args.end
57
  batch_size = args.batch_size
 
 
 
58
  for batch_idx in tqdm(range(begin, end, batch_size)):
59
  batch = data[batch_idx:min(batch_idx+batch_size, end)]
60
 
@@ -109,8 +112,9 @@ for batch_idx in tqdm(range(begin, end, batch_size)):
109
  idx_real = batch_idx * batch_size + idx
110
  save_list[idx]['result'] = x
111
  save_data.append(save_list[idx])
112
-
113
- json_path = args.prompt_path
 
114
  write_json(json_path,save_data)
115
 
116
 
 
55
  begin = args.begin
56
  end = args.end
57
  batch_size = args.batch_size
58
+ json_path = args.prompt_path
59
+
60
+
61
  for batch_idx in tqdm(range(begin, end, batch_size)):
62
  batch = data[batch_idx:min(batch_idx+batch_size, end)]
63
 
 
112
  idx_real = batch_idx * batch_size + idx
113
  save_list[idx]['result'] = x
114
  save_data.append(save_list[idx])
115
+ if batch_idx % 4 ==0:
116
+ write_json(json_path,save_data)
117
+
118
  write_json(json_path,save_data)
119
 
120