Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -78,22 +78,32 @@ def run_inference(model_name, prompt_text):
|
|
78 |
os.remove(prompt_file.name)
|
79 |
|
80 |
def main():
|
81 |
-
gr.
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
if __name__ == "__main__":
|
99 |
main()
|
|
|
78 |
os.remove(prompt_file.name)
|
79 |
|
80 |
def main():
|
81 |
+
with gr.Blocks() as demo:
|
82 |
+
gr.Markdown("# Open-Sora Inference")
|
83 |
+
gr.Markdown("Run Open-Sora Inference with custom parameters.")
|
84 |
+
|
85 |
+
with gr.Row():
|
86 |
+
with gr.Column(scale=1):
|
87 |
+
model_dropdown = gr.Dropdown(
|
88 |
+
choices=[
|
89 |
+
"OpenSora-v1-16x256x256.pth",
|
90 |
+
"OpenSora-v1-HQ-16x256x256.pth",
|
91 |
+
"OpenSora-v1-HQ-16x512x512.pth"
|
92 |
+
],
|
93 |
+
label="Model Selection"
|
94 |
+
)
|
95 |
+
prompt_text = gr.Textbox(label="Prompt Text", value="Enter prompt text here", lines=4)
|
96 |
+
submit_button = gr.Button("Run Inference")
|
97 |
+
|
98 |
+
output_video = gr.Video(label="Output Video")
|
99 |
+
|
100 |
+
submit_button.click(
|
101 |
+
fn=run_inference,
|
102 |
+
inputs=[model_dropdown, prompt_text],
|
103 |
+
outputs=output_video
|
104 |
+
)
|
105 |
+
|
106 |
+
demo.launch()
|
107 |
|
108 |
if __name__ == "__main__":
|
109 |
main()
|