Spaces:
Runtime error
Runtime error
RamAnanth1
commited on
Commit
β’
21c2481
1
Parent(s):
4ab14ca
Update app.py
Browse files
app.py
CHANGED
@@ -105,15 +105,16 @@ def save_results(videos,
|
|
105 |
npz_to_video_grid(videos[i:i+1,...],
|
106 |
os.path.join(save_subdir, f"{save_name}_{i:03d}.mp4"),
|
107 |
fps=save_fps)
|
108 |
-
|
|
|
109 |
|
110 |
def get_video(prompt):
|
111 |
samples = sample_text2video(model, prompt, n_samples = 1, batch_size = 1,
|
112 |
sampler=ddim_sampler,
|
113 |
)
|
114 |
-
|
115 |
return save_results(samples)
|
116 |
|
117 |
prompt_inp = gr.Textbox(label = "Prompt")
|
118 |
-
|
|
|
119 |
iface.launch()
|
|
|
105 |
npz_to_video_grid(videos[i:i+1,...],
|
106 |
os.path.join(save_subdir, f"{save_name}_{i:03d}.mp4"),
|
107 |
fps=save_fps)
|
108 |
+
|
109 |
+
return os.path.join(save_subdir, f"{save_name}_{i:03d}.mp4")
|
110 |
|
111 |
def get_video(prompt):
|
112 |
samples = sample_text2video(model, prompt, n_samples = 1, batch_size = 1,
|
113 |
sampler=ddim_sampler,
|
114 |
)
|
|
|
115 |
return save_results(samples)
|
116 |
|
117 |
prompt_inp = gr.Textbox(label = "Prompt")
|
118 |
+
result = gr.Video(label='Result')
|
119 |
+
iface = gr.Interface(fn=get_video, inputs=[prompt_inp], outputs=[result])
|
120 |
iface.launch()
|