Spaces:
Running
Running
Commit
·
2cbaf0c
1
Parent(s):
a6823a6
Minor
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import torch
|
|
| 5 |
import numpy as np
|
| 6 |
import gradio as gr
|
| 7 |
import gdown
|
|
|
|
| 8 |
|
| 9 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
| 10 |
print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
|
@@ -111,8 +112,8 @@ autoplay loop disablepictureinpicture id="{video_id}">
|
|
| 111 |
def generate_component(generate_function, text):
|
| 112 |
if text == DEFAULT_TEXT or text == "" or text is None:
|
| 113 |
return [None for _ in range(4)]
|
| 114 |
-
|
| 115 |
-
datas = generate_function(text, )
|
| 116 |
htmls = [get_video_html(data, idx) for idx, data in enumerate(datas)]
|
| 117 |
return htmls
|
| 118 |
|
|
|
|
| 5 |
import numpy as np
|
| 6 |
import gradio as gr
|
| 7 |
import gdown
|
| 8 |
+
import random
|
| 9 |
|
| 10 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
| 11 |
print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
|
|
|
| 112 |
def generate_component(generate_function, text):
|
| 113 |
if text == DEFAULT_TEXT or text == "" or text is None:
|
| 114 |
return [None for _ in range(4)]
|
| 115 |
+
uid = random.randrange(99999)
|
| 116 |
+
datas = generate_function(text, uid)
|
| 117 |
htmls = [get_video_html(data, idx) for idx, data in enumerate(datas)]
|
| 118 |
return htmls
|
| 119 |
|