Spaces:
Sleeping
Sleeping
Update run.py
Browse files
run.py
CHANGED
@@ -28,9 +28,8 @@ def fast_caption(sys_prompt, usr_prompt, temp, top_p, max_tokens, model, key, en
|
|
28 |
progress_info = []
|
29 |
with tempfile.TemporaryDirectory() as temp_dir:
|
30 |
# temp_dir = '/opt/run'
|
31 |
-
csv_filename = os.path.join('/dev/shm', str(parquet_index).zfill(6) + '_gpt4o_caption.csv')
|
32 |
-
|
33 |
-
print(csv_filename)
|
34 |
with open(csv_filename, mode='w', newline='') as csv_file:
|
35 |
fieldnames = ['md5', 'caption']
|
36 |
writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
|
@@ -70,10 +69,10 @@ def fast_caption(sys_prompt, usr_prompt, temp, top_p, max_tokens, model, key, en
|
|
70 |
# writer.writerow({'md5': md5, 'caption': 'caption'})
|
71 |
progress_info.append(f"Processed video with MD5: {md5}")
|
72 |
i += 1
|
73 |
-
if i == 1:
|
74 |
-
|
75 |
-
|
76 |
-
return csv_filename, "\n".join(progress_info), None
|
77 |
else:
|
78 |
return "", "No video source selected.", None
|
79 |
|
|
|
28 |
progress_info = []
|
29 |
with tempfile.TemporaryDirectory() as temp_dir:
|
30 |
# temp_dir = '/opt/run'
|
31 |
+
# csv_filename = os.path.join('/dev/shm', str(parquet_index).zfill(6) + '_gpt4o_caption.csv')
|
32 |
+
csv_filename = '/dev/shm/caption.csv'
|
|
|
33 |
with open(csv_filename, mode='w', newline='') as csv_file:
|
34 |
fieldnames = ['md5', 'caption']
|
35 |
writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
|
|
|
69 |
# writer.writerow({'md5': md5, 'caption': 'caption'})
|
70 |
progress_info.append(f"Processed video with MD5: {md5}")
|
71 |
i += 1
|
72 |
+
# if i == 1:
|
73 |
+
# break
|
74 |
+
return csv_filename, "\n".join(progress_info), None
|
75 |
+
# return csv_filename, "\n".join(progress_info), None
|
76 |
else:
|
77 |
return "", "No video source selected.", None
|
78 |
|