Skip to content

Commit

Permalink
fix demucs, change postgres port
Browse files Browse the repository at this point in the history
  • Loading branch information
rsxdalv committed Oct 16, 2024
1 parent 0697b69 commit 3e7652e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def signal_handler(signal, frame, postgres_process):
print("Info: Docker mode: skipping Postgres")
return
print("Starting Postgres...")
postgres_process = subprocess.Popen(f"postgres -D {postgres_dir}", shell=True)
postgres_process = subprocess.Popen(f"postgres -D {postgres_dir} -p 7773", shell=True)
try:
signal.signal(
signal.SIGINT,
Expand Down
8 changes: 4 additions & 4 deletions tts_webui/demucs/demucs_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@


@manage_model_state("demucs")
def _get_demucs_model():
def _get_demucs_model(model_name="htdemucs"):
from demucs import pretrained

return pretrained.get_model("htdemucs")
return pretrained.get_model(model_name)


def apply_demucs(wav, sr):
from demucs.audio import convert_audio
from demucs.apply import apply_model

demucs_model = _get_demucs_model()
demucs_model = _get_demucs_model(model_name="htdemucs")

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
wav = convert_audio(wav, sr, demucs_model.samplerate, demucs_model.audio_channels)
Expand All @@ -28,7 +28,7 @@ def apply_demucs(wav, sr):


def demucs_audio(audio):
demucs_model = _get_demucs_model()
demucs_model = _get_demucs_model(model_name="htdemucs")
wav, sr = torchaudio.load(audio)
out = apply_demucs(wav=wav.unsqueeze(0), sr=sr)

Expand Down

0 comments on commit 3e7652e

Please sign in to comment.