Spaces:
Build error
Build error
Commit
·
3d89bc0
1
Parent(s):
dbeab5b
Minor
Browse files
app.py
CHANGED
|
@@ -90,7 +90,7 @@ CSS = """
|
|
| 90 |
DEFAULT_TEXT = "A person is "
|
| 91 |
|
| 92 |
def generate(
|
| 93 |
-
text, uid, motion_length=0, seed=10107, repeat_times=
|
| 94 |
):
|
| 95 |
os.system(f'python gen_t2m.py --gpu_id 0 --seed {seed} --ext {uid} --repeat_times {repeat_times} --motion_length {motion_length} --text_prompt "{text}"')
|
| 96 |
datas = []
|
|
@@ -123,7 +123,7 @@ autoplay loop disablepictureinpicture id="{video_id}">
|
|
| 123 |
|
| 124 |
def generate_component(generate_function, text):
|
| 125 |
if text == DEFAULT_TEXT or text == "" or text is None:
|
| 126 |
-
return [None for _ in range(
|
| 127 |
uid = random.randrange(99999)
|
| 128 |
datas = generate_function(text, uid)
|
| 129 |
htmls = [get_video_html(data, idx) for idx, data in enumerate(datas)]
|
|
@@ -177,7 +177,7 @@ with gr.Blocks(css=CSS, theme=theme) as demo:
|
|
| 177 |
# should indent
|
| 178 |
for _ in range(1):
|
| 179 |
with gr.Row():
|
| 180 |
-
for _ in range(
|
| 181 |
i += 1
|
| 182 |
video = gr.HTML()
|
| 183 |
videos.append(video)
|
|
@@ -211,7 +211,7 @@ with gr.Blocks(css=CSS, theme=theme) as demo:
|
|
| 211 |
)
|
| 212 |
|
| 213 |
def clear_videos():
|
| 214 |
-
return [None for x in range(
|
| 215 |
|
| 216 |
clear.click(fn=clear_videos, outputs=videos + [text])
|
| 217 |
|
|
|
|
| 90 |
DEFAULT_TEXT = "A person is "
|
| 91 |
|
| 92 |
def generate(
|
| 93 |
+
text, uid, motion_length=0, seed=10107, repeat_times=1,
|
| 94 |
):
|
| 95 |
os.system(f'python gen_t2m.py --gpu_id 0 --seed {seed} --ext {uid} --repeat_times {repeat_times} --motion_length {motion_length} --text_prompt "{text}"')
|
| 96 |
datas = []
|
|
|
|
| 123 |
|
| 124 |
def generate_component(generate_function, text):
|
| 125 |
if text == DEFAULT_TEXT or text == "" or text is None:
|
| 126 |
+
return [None for _ in range(1)]
|
| 127 |
uid = random.randrange(99999)
|
| 128 |
datas = generate_function(text, uid)
|
| 129 |
htmls = [get_video_html(data, idx) for idx, data in enumerate(datas)]
|
|
|
|
| 177 |
# should indent
|
| 178 |
for _ in range(1):
|
| 179 |
with gr.Row():
|
| 180 |
+
for _ in range(1):
|
| 181 |
i += 1
|
| 182 |
video = gr.HTML()
|
| 183 |
videos.append(video)
|
|
|
|
| 211 |
)
|
| 212 |
|
| 213 |
def clear_videos():
|
| 214 |
+
return [None for x in range(1)] + [DEFAULT_TEXT]
|
| 215 |
|
| 216 |
clear.click(fn=clear_videos, outputs=videos + [text])
|
| 217 |
|