lalalalalalalalalala commited on
Commit
e09b4da
·
verified ·
1 Parent(s): a22ab2a

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +2 -2
run.py CHANGED
@@ -18,8 +18,8 @@ def load_hf_dataset(dataset_path, auth_token):
18
 
19
  def fast_caption(sys_prompt, usr_prompt, temp, top_p, max_tokens, model, key, endpoint, video_src, video_hf, video_hf_auth, parquet_index, video_od, video_od_auth, video_gd, video_gd_auth, frame_format, frame_limit):
20
  progress_info = []
21
- csv_filename = "captions.csv"
22
- with open(csv_filename, mode='w', newline='') as csv_file:
23
  fieldnames = ['md5', 'caption']
24
  writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
25
  writer.writeheader()
 
18
 
19
  def fast_caption(sys_prompt, usr_prompt, temp, top_p, max_tokens, model, key, endpoint, video_src, video_hf, video_hf_auth, parquet_index, video_od, video_od_auth, video_gd, video_gd_auth, frame_format, frame_limit):
20
  progress_info = []
21
+ with tempfile.NamedTemporaryFile(mode='w', delete=False, newline='') as csv_file:
22
+ csv_filename = csv_file.name
23
  fieldnames = ['md5', 'caption']
24
  writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
25
  writer.writeheader()