Spaces:
Running
on
Zero
Running
on
Zero
yuanshengni
commited on
Commit
•
23ef2f0
1
Parent(s):
42288e0
update vg vote utils
Browse files- serve/vote_utils.py +10 -8
serve/vote_utils.py
CHANGED
@@ -810,7 +810,7 @@ def generate_vg(gen_func, state, text, model_name, request: gr.Request):
|
|
810 |
state.output = generated_video
|
811 |
state.model_name = model_name
|
812 |
|
813 |
-
|
814 |
|
815 |
finish_tstamp = time.time()
|
816 |
|
@@ -840,7 +840,7 @@ def generate_vg(gen_func, state, text, model_name, request: gr.Request):
|
|
840 |
imageio.mimwrite(output_file, state.output, fps=8, quality=9)
|
841 |
|
842 |
save_video_file_on_log_server(output_file)
|
843 |
-
yield state, output_file
|
844 |
|
845 |
def generate_vgm(gen_func, state0, state1, text, model_name0, model_name1, request: gr.Request):
|
846 |
if not text:
|
@@ -866,6 +866,8 @@ def generate_vgm(gen_func, state0, state1, text, model_name0, model_name1, reque
|
|
866 |
state1.output = generated_video1
|
867 |
state0.model_name = model_name0
|
868 |
state1.model_name = model_name1
|
|
|
|
|
869 |
print("====== model name =========")
|
870 |
print(state0.model_name)
|
871 |
print(state1.model_name)
|
@@ -915,7 +917,7 @@ def generate_vgm(gen_func, state0, state1, text, model_name0, model_name1, reque
|
|
915 |
print(state.output.shape)
|
916 |
imageio.mimwrite(output_file, state.output, fps=8, quality=9)
|
917 |
save_video_file_on_log_server(output_file)
|
918 |
-
yield state0, state1, f'{VIDEO_DIR}/generation/{state0.conv_id}.mp4', f'{VIDEO_DIR}/generation/{state1.conv_id}.mp4'
|
919 |
|
920 |
|
921 |
def generate_vgm_annoy(gen_func, state0, state1, text, model_name0, model_name1, request: gr.Request):
|
@@ -937,9 +939,9 @@ def generate_vgm_annoy(gen_func, state0, state1, text, model_name0, model_name1,
|
|
937 |
state1.output = generated_video1
|
938 |
state0.model_name = model_name0
|
939 |
state1.model_name = model_name1
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
|
944 |
finish_tstamp = time.time()
|
945 |
# logger.info(f"===output===: {output}")
|
@@ -983,5 +985,5 @@ def generate_vgm_annoy(gen_func, state0, state1, text, model_name0, model_name1,
|
|
983 |
imageio.mimwrite(output_file, state.output, fps=8, quality=9)
|
984 |
save_video_file_on_log_server(output_file)
|
985 |
|
986 |
-
yield state0, state1, f'{VIDEO_DIR}/generation/{state0.conv_id}.mp4', f'{VIDEO_DIR}/generation/{state1.conv_id}.mp4', \
|
987 |
-
|
|
|
810 |
state.output = generated_video
|
811 |
state.model_name = model_name
|
812 |
|
813 |
+
yield state, generated_video
|
814 |
|
815 |
finish_tstamp = time.time()
|
816 |
|
|
|
840 |
imageio.mimwrite(output_file, state.output, fps=8, quality=9)
|
841 |
|
842 |
save_video_file_on_log_server(output_file)
|
843 |
+
# yield state, output_file
|
844 |
|
845 |
def generate_vgm(gen_func, state0, state1, text, model_name0, model_name1, request: gr.Request):
|
846 |
if not text:
|
|
|
866 |
state1.output = generated_video1
|
867 |
state0.model_name = model_name0
|
868 |
state1.model_name = model_name1
|
869 |
+
|
870 |
+
yield state0, state1, generated_video0, generated_video1
|
871 |
print("====== model name =========")
|
872 |
print(state0.model_name)
|
873 |
print(state1.model_name)
|
|
|
917 |
print(state.output.shape)
|
918 |
imageio.mimwrite(output_file, state.output, fps=8, quality=9)
|
919 |
save_video_file_on_log_server(output_file)
|
920 |
+
# yield state0, state1, f'{VIDEO_DIR}/generation/{state0.conv_id}.mp4', f'{VIDEO_DIR}/generation/{state1.conv_id}.mp4'
|
921 |
|
922 |
|
923 |
def generate_vgm_annoy(gen_func, state0, state1, text, model_name0, model_name1, request: gr.Request):
|
|
|
939 |
state1.output = generated_video1
|
940 |
state0.model_name = model_name0
|
941 |
state1.model_name = model_name1
|
942 |
+
|
943 |
+
yield state0, state1, generated_video0, generated_video1, \
|
944 |
+
gr.Markdown(f"### Model A: {model_name0}"), gr.Markdown(f"### Model B: {model_name1}")
|
945 |
|
946 |
finish_tstamp = time.time()
|
947 |
# logger.info(f"===output===: {output}")
|
|
|
985 |
imageio.mimwrite(output_file, state.output, fps=8, quality=9)
|
986 |
save_video_file_on_log_server(output_file)
|
987 |
|
988 |
+
# yield state0, state1, f'{VIDEO_DIR}/generation/{state0.conv_id}.mp4', f'{VIDEO_DIR}/generation/{state1.conv_id}.mp4', \
|
989 |
+
# gr.Markdown(f"### Model A: {model_name0}"), gr.Markdown(f"### Model B: {model_name1}")
|