Spaces:
Running on Zero
Running on Zero
Update webui.py
Browse files
webui.py
CHANGED
|
@@ -6,6 +6,7 @@ import sys
|
|
| 6 |
import traceback
|
| 7 |
from pathlib import Path
|
| 8 |
from typing import Literal, Tuple
|
|
|
|
| 9 |
|
| 10 |
import numpy as np
|
| 11 |
import torch
|
|
@@ -169,6 +170,7 @@ class AppState:
|
|
| 169 |
)
|
| 170 |
self.phoneset_path = "soulxsinger/utils/phoneme/phone_set.json"
|
| 171 |
|
|
|
|
| 172 |
def run_preprocess(
|
| 173 |
self,
|
| 174 |
prompt_path: Path,
|
|
@@ -198,6 +200,7 @@ class AppState:
|
|
| 198 |
except Exception as e:
|
| 199 |
return False, f"preprocess failed: {e}"
|
| 200 |
|
|
|
|
| 201 |
def run_svs(
|
| 202 |
self,
|
| 203 |
control: str,
|
|
@@ -234,6 +237,7 @@ class AppState:
|
|
| 234 |
except Exception as e:
|
| 235 |
return False, f"svs inference failed: {e}", None, prompt_meta_path, target_meta_path
|
| 236 |
|
|
|
|
| 237 |
def run_svs_from_paths(
|
| 238 |
self,
|
| 239 |
prompt_wav_path: str,
|
|
@@ -364,7 +368,7 @@ def _resolve_file_path(x):
|
|
| 364 |
x = x[0]
|
| 365 |
return x if (x and os.path.isfile(x)) else None
|
| 366 |
|
| 367 |
-
|
| 368 |
def transcription_function(
|
| 369 |
prompt_audio,
|
| 370 |
target_audio,
|
|
@@ -431,7 +435,7 @@ def transcription_function(
|
|
| 431 |
print(traceback.format_exc(), file=sys.stderr, flush=True)
|
| 432 |
return None, None
|
| 433 |
|
| 434 |
-
|
| 435 |
def synthesis_function(
|
| 436 |
prompt_audio,
|
| 437 |
prompt_metadata,
|
|
|
|
| 6 |
import traceback
|
| 7 |
from pathlib import Path
|
| 8 |
from typing import Literal, Tuple
|
| 9 |
+
import spaces
|
| 10 |
|
| 11 |
import numpy as np
|
| 12 |
import torch
|
|
|
|
| 170 |
)
|
| 171 |
self.phoneset_path = "soulxsinger/utils/phoneme/phone_set.json"
|
| 172 |
|
| 173 |
+
@spaces.GPU
|
| 174 |
def run_preprocess(
|
| 175 |
self,
|
| 176 |
prompt_path: Path,
|
|
|
|
| 200 |
except Exception as e:
|
| 201 |
return False, f"preprocess failed: {e}"
|
| 202 |
|
| 203 |
+
@spaces.GPU
|
| 204 |
def run_svs(
|
| 205 |
self,
|
| 206 |
control: str,
|
|
|
|
| 237 |
except Exception as e:
|
| 238 |
return False, f"svs inference failed: {e}", None, prompt_meta_path, target_meta_path
|
| 239 |
|
| 240 |
+
@spaces.GPU
|
| 241 |
def run_svs_from_paths(
|
| 242 |
self,
|
| 243 |
prompt_wav_path: str,
|
|
|
|
| 368 |
x = x[0]
|
| 369 |
return x if (x and os.path.isfile(x)) else None
|
| 370 |
|
| 371 |
+
@spaces.GPU
|
| 372 |
def transcription_function(
|
| 373 |
prompt_audio,
|
| 374 |
target_audio,
|
|
|
|
| 435 |
print(traceback.format_exc(), file=sys.stderr, flush=True)
|
| 436 |
return None, None
|
| 437 |
|
| 438 |
+
@spaces.GPU
|
| 439 |
def synthesis_function(
|
| 440 |
prompt_audio,
|
| 441 |
prompt_metadata,
|