Spaces:
Sleeping
Sleeping
fix import spaces zero_gpu error https://discuss.huggingface.co/t/issues-with-sadtalker-zerogpu-spaces-inquiry-about-community-grant/110625/10
Browse files
app.py
CHANGED
@@ -1,3 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
import os
|
@@ -8,6 +21,10 @@ import utilities as us
|
|
8 |
import plotly.express as px
|
9 |
import plotly.graph_objects as go
|
10 |
|
|
|
|
|
|
|
|
|
11 |
with open('style.css', 'r') as file:
|
12 |
css = file.read()
|
13 |
|
|
|
1 |
+
|
2 |
+
import os
|
3 |
+
# https://discuss.huggingface.co/t/issues-with-sadtalker-zerogpu-spaces-inquiry-about-community-grant/110625/10
|
4 |
+
if os.environ.get("SPACES_ZERO_GPU") is not None:
|
5 |
+
import spaces
|
6 |
+
else:
|
7 |
+
class spaces:
|
8 |
+
@staticmethod
|
9 |
+
def GPU(func):
|
10 |
+
def wrapper(*args, **kwargs):
|
11 |
+
return func(*args, **kwargs)
|
12 |
+
return wrapper
|
13 |
+
|
14 |
import gradio as gr
|
15 |
import pandas as pd
|
16 |
import os
|
|
|
21 |
import plotly.express as px
|
22 |
import plotly.graph_objects as go
|
23 |
|
24 |
+
@spaces.GPU
|
25 |
+
def model_prediction():
|
26 |
+
pass
|
27 |
+
|
28 |
with open('style.css', 'r') as file:
|
29 |
css = file.read()
|
30 |
|