Spaces:
Build error
Build error
| import gradio as gr | |
| import torch | |
| from longcat_video import LongcatVideoPipeline | |
| pipe = LongcatVideoPipeline.from_pretrained( | |
| "meituan-longcat/LongCat-Video", | |
| torch_dtype=torch.float16, | |
| device_map="auto" | |
| ) | |
| def generate_video(prompt): | |
| video = pipe.text_to_video(prompt) | |
| video.save("output.mp4") | |
| return "output.mp4" | |
| gr.Interface( | |
| fn=generate_video, | |
| inputs=gr.Textbox(label="Prompt"), | |
| outputs=gr.Video(label="Output Video"), | |
| title="LongCat-Video Demo" | |
| ).launch() | |