Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added websocket server #1029

Draft
wants to merge 6 commits into
base: v2.1
Choose a base branch
from
Draft

added websocket server #1029

wants to merge 6 commits into from

Conversation

ben-mkiv
Copy link

@ben-mkiv ben-mkiv commented Aug 16, 2023

this required to refactor some of the code to avoid circular dependencies. as a result the CLI code could be greatly reduced and is now pretty simple

  • pytaglib was added as requirement, which is now used to keep meta data from the source file and to add meta data with the RVC generation flags to the output file (this could/should probably also be added to batch conversion)
  • cli interface was made executable so that it can be run from CLI on linux/mac systems

websocket server listens by default on localhost:15159 (it's NOT recommended to run the websocket server on a public network/interface, since there's no security checks implemented)

example requests:

process an audio file and save the output to

{
    "action": "generate",
    "input_audio_path": "/path/to/some/audio.wav",
    "output_path": "/path/to/some/output.wav",
    "model_path": "/path/to/Retrieval-based-Voice-Conversion-WebUI/weights/SomeVoiceWeight.pth"
}

get a list of available voice weights

{
    "action": "get_voice_weights"
}

this required to refactor some of the code to avoid circular dependencies. as a result the CLI code could be greatly reduced and is now pretty simple
* pytaglib was added as requirement, which is now used to keep meta data from the source file and to add meta data with the RVC generation flags to the output file (this could/should probably also be added to batch conversion)
* cli interface was made executable so that it can be run from CLI on linux/mac systems
@ben-mkiv ben-mkiv mentioned this pull request Aug 19, 2023
5 tasks
@Tps-F Tps-F added the enhancement ✨功能增强 label Aug 19, 2023
Copy link
Member

@fumiama fumiama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function of the src folder is similar to existing lib folder, thus all of its contents can be merged into lib.

@@ -70,6 +58,10 @@ def forward_dml(ctx, x, scale):
mem = []
if_gpu_ok = False



start_websocket_server('127.0.0.1', 15159)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also add this to config and add a commandline parameter to control this.

@@ -18,26 +18,23 @@
from subprocess import Popen
from time import sleep

from src.configuration import *
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to specify all components used but not *.

import os
from src.configuration import weight_root

def get_voice_weights():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this can be put into lib/audio.py

@ben-mkiv
Copy link
Author

yeah, doesn't make sense to make any changes now if the PR is stall anyways and conflicting with the cleanup which is in progress now...

I'll eventually come back to this when the cleanup is done.

@fumiama
Copy link
Member

fumiama commented Aug 26, 2023

OK. It won't take a long time.

@ben-mkiv ben-mkiv marked this pull request as draft August 28, 2023 15:22
@fumiama fumiama changed the base branch from main to dev September 20, 2023 14:08
@fumiama fumiama changed the base branch from v2 to dev October 6, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨功能增强
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants