Spaces:
Running
on
Zero
Running
on
Zero
Add ZeroSpace and share=True (#8)
Browse files- Add ZeroSpace and share=True (972a79008dcc2c05ef1bfdb602a7d480e378ff4a)
Co-authored-by: Francesco Giannuzzo <[email protected]>
app.py
CHANGED
@@ -1,6 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
import sys
|
5 |
from qatch.connectors.sqlite_connector import SqliteConnector
|
6 |
from qatch.generate_dataset.orchestrator_generator import OrchestratorGenerator
|
@@ -13,6 +23,10 @@ import plotly.express as px
|
|
13 |
import plotly.graph_objects as go
|
14 |
import plotly.colors as pc
|
15 |
|
|
|
|
|
|
|
|
|
16 |
with open('style.css', 'r') as file:
|
17 |
css = file.read()
|
18 |
|
@@ -826,4 +840,4 @@ with gr.Blocks(theme='d8ahazard/rd_blue', css_paths='style.css') as interface:
|
|
826 |
outputs=[output_plot, query_rate_plot, radar_plot, ranking_text_display, worst_cases_display, load_trigger]
|
827 |
)
|
828 |
|
829 |
-
interface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
import os
|
4 |
+
# https://discuss.huggingface.co/t/issues-with-sadtalker-zerogpu-spaces-inquiry-about-community-grant/110625/10
|
5 |
+
if os.environ.get("SPACES_ZERO_GPU") is not None:
|
6 |
+
import spaces
|
7 |
+
else:
|
8 |
+
class spaces:
|
9 |
+
@staticmethod
|
10 |
+
def GPU(func):
|
11 |
+
def wrapper(*args, **kwargs):
|
12 |
+
return func(*args, **kwargs)
|
13 |
+
return wrapper
|
14 |
import sys
|
15 |
from qatch.connectors.sqlite_connector import SqliteConnector
|
16 |
from qatch.generate_dataset.orchestrator_generator import OrchestratorGenerator
|
|
|
23 |
import plotly.graph_objects as go
|
24 |
import plotly.colors as pc
|
25 |
|
26 |
+
@spaces.GPU
|
27 |
+
def model_prediction():
|
28 |
+
pass
|
29 |
+
|
30 |
with open('style.css', 'r') as file:
|
31 |
css = file.read()
|
32 |
|
|
|
840 |
outputs=[output_plot, query_rate_plot, radar_plot, ranking_text_display, worst_cases_display, load_trigger]
|
841 |
)
|
842 |
|
843 |
+
interface.launch(share=True)
|