Spaces:
Build error
Build error
Commit ยท
605da91
1
Parent(s): a76fcef
added torch check for GPU
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
from video_watermark_remover import *
|
| 4 |
from video_converter import *
|
|
@@ -19,7 +20,7 @@ class FakeLamaArgs(BaseModel):
|
|
| 19 |
sd_enable_xformers: bool = False
|
| 20 |
local_files_only: bool = False
|
| 21 |
cpu_offload: bool = False
|
| 22 |
-
device: str = "cuda"
|
| 23 |
gui: bool = False
|
| 24 |
gui_size: List[int] = [1000, 1000]
|
| 25 |
input: str = ''
|
|
@@ -27,7 +28,7 @@ class FakeLamaArgs(BaseModel):
|
|
| 27 |
debug: bool = False
|
| 28 |
no_half: bool = False
|
| 29 |
disable_nsfw: bool = False
|
| 30 |
-
enable_xformers: bool = True
|
| 31 |
model_dir: str = None
|
| 32 |
output_dir: str = None
|
| 33 |
|
|
|
|
| 1 |
import os
|
| 2 |
+
import torch
|
| 3 |
import gradio as gr
|
| 4 |
from video_watermark_remover import *
|
| 5 |
from video_converter import *
|
|
|
|
| 20 |
sd_enable_xformers: bool = False
|
| 21 |
local_files_only: bool = False
|
| 22 |
cpu_offload: bool = False
|
| 23 |
+
device: str = "cuda" if torch.cuda.is_available() else "cpu"
|
| 24 |
gui: bool = False
|
| 25 |
gui_size: List[int] = [1000, 1000]
|
| 26 |
input: str = ''
|
|
|
|
| 28 |
debug: bool = False
|
| 29 |
no_half: bool = False
|
| 30 |
disable_nsfw: bool = False
|
| 31 |
+
enable_xformers: bool = True if torch.cuda.is_available() else False
|
| 32 |
model_dir: str = None
|
| 33 |
output_dir: str = None
|
| 34 |
|