Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions infer-web.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,20 @@ def change_choices():
}


def get_current_loaded_info():
current_model = getattr(vc, "loaded_model_id", None)

model_name = current_model if current_model else i18n("Model Not Loaded")

data = {
"status": "success",
"model_file_name": model_name,
"info": i18n("Successfully retrieved loaded voice info."),
}

return data


def clean():
return {"value": "", "__type__": "update"}

Expand Down Expand Up @@ -835,6 +849,18 @@ def change_f0_method(f0method8):
fn=clean, inputs=[], outputs=[sid0], api_name="infer_clean"
)
with gr.TabItem(i18n("单次推理")):
vc_status_output_json = gr.JSON(
label=i18n("Current Load Status JSON"),
visible=False,
value=get_current_loaded_info(),
)
vc_status_button = gr.Button(i18n("Check Load Status"), visible=False)
vc_status_button.click(
fn=get_current_loaded_info,
inputs=[],
outputs=[vc_status_output_json],
api_name="infer_loaded_voice",
)
with gr.Group():
with gr.Row():
with gr.Column():
Expand Down
2 changes: 2 additions & 0 deletions infer/modules/vc/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def get_vc(self, sid, *to_return_protect):
index = {"value": get_index_path_from_model(sid), "__type__": "update"}
logger.info("Select index: " + index["value"])

self.loaded_model_id = sid

return (
(
{"visible": True, "maximum": n_spk, "__type__": "update"},
Expand Down