Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -19,6 +19,13 @@ from assets.discord_presence import rich_presence
|
|
19 |
|
20 |
rich_presence()
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
with gr.Blocks(theme="ParityError/Interstellar", title="Applio") as Applio:
|
23 |
gr.Markdown("# Applio")
|
24 |
gr.Markdown(
|
@@ -34,8 +41,9 @@ with gr.Blocks(theme="ParityError/Interstellar", title="Applio") as Applio:
|
|
34 |
with gr.Tab(i18n("Inference")):
|
35 |
inference_tab()
|
36 |
|
37 |
-
|
38 |
-
|
|
|
39 |
|
40 |
with gr.Tab(i18n("TTS")):
|
41 |
tts_tab()
|
@@ -50,9 +58,5 @@ with gr.Blocks(theme="ParityError/Interstellar", title="Applio") as Applio:
|
|
50 |
report_tab()
|
51 |
|
52 |
if __name__ == "__main__":
|
53 |
-
Applio.launch(
|
54 |
-
|
55 |
-
share="--share" in sys.argv,
|
56 |
-
inbrowser="--open" in sys.argv,
|
57 |
-
server_port=6969,
|
58 |
-
)
|
|
|
19 |
|
20 |
rich_presence()
|
21 |
|
22 |
+
try:
|
23 |
+
from tensorflow.python.client import device_lib
|
24 |
+
|
25 |
+
gpus = [device.name for device in device_lib.list_local_devices() if device.device_type == "GPU"]
|
26 |
+
except ImportError:
|
27 |
+
gpus = []
|
28 |
+
|
29 |
with gr.Blocks(theme="ParityError/Interstellar", title="Applio") as Applio:
|
30 |
gr.Markdown("# Applio")
|
31 |
gr.Markdown(
|
|
|
41 |
with gr.Tab(i18n("Inference")):
|
42 |
inference_tab()
|
43 |
|
44 |
+
if gpus:
|
45 |
+
with gr.Tab(i18n("Train")):
|
46 |
+
train_tab()
|
47 |
|
48 |
with gr.Tab(i18n("TTS")):
|
49 |
tts_tab()
|
|
|
58 |
report_tab()
|
59 |
|
60 |
if __name__ == "__main__":
|
61 |
+
Applio.launch()
|
62 |
+
# share=True
|
|
|
|
|
|
|
|