Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,22 @@
|
|
1 |
-
|
2 |
from diffusers import DiffusionPipeline
|
3 |
|
4 |
-
|
|
|
5 |
|
6 |
-
def
|
|
|
|
|
|
|
7 |
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
if __name__ == "__main__":
|
12 |
-
|
13 |
-
print(result)
|
|
|
1 |
+
import gradio as gr
|
2 |
from diffusers import DiffusionPipeline
|
3 |
|
4 |
+
# Load the model
|
5 |
+
pipeline = DiffusionPipeline.from_pretrained("ali-vilab/text-to-video-ms-1.7b")
|
6 |
|
7 |
+
def generate_video(text):
|
8 |
+
video = pipeline(text)
|
9 |
+
# Assuming the output is a video file or a binary stream. Adjust accordingly.
|
10 |
+
return video
|
11 |
|
12 |
+
# Create the Gradio interface
|
13 |
+
interface = gr.Interface(
|
14 |
+
fn=generate_video,
|
15 |
+
inputs=gr.Textbox(lines=2, placeholder="Type your text here..."),
|
16 |
+
outputs=gr.Video(),
|
17 |
+
title="Text-to-Video Generator",
|
18 |
+
description="Enter some text and generate a video!"
|
19 |
+
)
|
20 |
|
21 |
if __name__ == "__main__":
|
22 |
+
interface.launch()
|
|