Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -6,12 +6,15 @@ os.system("pip3 install torch torchvision torchaudio --index-url https://downloa
|
|
| 6 |
import gradio as gr
|
| 7 |
import torch
|
| 8 |
import subprocess
|
| 9 |
-
|
| 10 |
|
| 11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 12 |
|
|
|
|
|
|
|
| 13 |
def infer():
|
| 14 |
-
|
|
|
|
| 15 |
file_path = f"result/output.mp4"
|
| 16 |
return file_path
|
| 17 |
|
|
@@ -30,6 +33,7 @@ with gr.Blocks() as demo:
|
|
| 30 |
gr.Markdown(f"""
|
| 31 |
# Short Video Generator
|
| 32 |
-- Click run to generate video --
|
|
|
|
| 33 |
Currently running on {power_device}.
|
| 34 |
""")
|
| 35 |
|
|
@@ -37,6 +41,7 @@ with gr.Blocks() as demo:
|
|
| 37 |
run_button = gr.Button("Run", scale=0)
|
| 38 |
change_track_button = gr.Button("Change Track", scale=0)
|
| 39 |
|
|
|
|
| 40 |
result = gr.Video()
|
| 41 |
result_changed = gr.Video()
|
| 42 |
|
|
|
|
| 6 |
import gradio as gr
|
| 7 |
import torch
|
| 8 |
import subprocess
|
| 9 |
+
from main import create_original
|
| 10 |
|
| 11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 12 |
|
| 13 |
+
secret_api = os.getenv("YOUR_GEMINI_API")
|
| 14 |
+
|
| 15 |
def infer():
|
| 16 |
+
title = None
|
| 17 |
+
create_original(api_key=secret_api, des=title)
|
| 18 |
file_path = f"result/output.mp4"
|
| 19 |
return file_path
|
| 20 |
|
|
|
|
| 33 |
gr.Markdown(f"""
|
| 34 |
# Short Video Generator
|
| 35 |
-- Click run to generate video --
|
| 36 |
+
|
| 37 |
Currently running on {power_device}.
|
| 38 |
""")
|
| 39 |
|
|
|
|
| 41 |
run_button = gr.Button("Run", scale=0)
|
| 42 |
change_track_button = gr.Button("Change Track", scale=0)
|
| 43 |
|
| 44 |
+
# title = gr.Textbox()
|
| 45 |
result = gr.Video()
|
| 46 |
result_changed = gr.Video()
|
| 47 |
|