Spaces:
Runtime error
Runtime error
File size: 1,107 Bytes
3549b42 349a298 2f71e91 ec9ca52 349a298 3b28ad1 0d7a6c1 3b28ad1 0d7a6c1 3b28ad1 0d7a6c1 3b28ad1 0d7a6c1 3b28ad1 0d7a6c1 3b28ad1 0d7a6c1 3b28ad1 0d7a6c1 3b28ad1 0d7a6c1 3b28ad1 0d7a6c1 3b28ad1 0d7a6c1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | import os
os.system("git clone https://github.com/Begineer17/Short-Video-Generator.git")
os.system("cd Short-Video-Generator")
os.system("pip install -r Short-Video-Generator/requirements.txt")
os.system("pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118")
import gradio as gr
import torch
import subprocess
device = "cuda" if torch.cuda.is_available() else "cpu"
def infer():
subprocess.call("make_original_video.bat")
file_path = f"result/melody.mp4"
return file_path
if torch.cuda.is_available():
power_device = "GPU"
else:
power_device = "CPU"
with gr.Blocks() as demo:
with gr.Column(elem_id="col-container"):
gr.Markdown(f"""
# Short Video Generator
-- Click run to generate video --
Currently running on {power_device}.
""")
with gr.Row():
run_button = gr.Button("Run", scale=0)
result = gr.Video()
run_button.click(
fn = infer,
inputs = [],
outputs = [result]
)
demo.queue().launch(share=True)
|