Skip to content
Open
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
8 changes: 6 additions & 2 deletions run_mimo_asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def transcribe(self, uploaded_audio, recorded_audio, language_choice):
print(error_msg)
return "", error_msg

def create_interface(self, default_model_path="", default_tokenizer_path=""):
def create_interface(self, default_model_path="", default_tokenizer_path="", init_status_msg=""):
with gr.Blocks(title="MiMo-V2.5-ASR Speech Recognition", theme=gr.themes.Soft()) as iface:
gr.Markdown("# MiMo-V2.5-ASR: Robust Speech Recognition")
gr.Markdown(
Expand Down Expand Up @@ -122,6 +122,7 @@ def create_interface(self, default_model_path="", default_tokenizer_path=""):
label="Initialization status",
interactive=False,
lines=6,
value=init_status_msg,
placeholder="Click the initialize model button to start...",
)
gr.Markdown("### System information")
Expand Down Expand Up @@ -221,14 +222,17 @@ def main():
print("Launch MiMo-V2.5-ASR demo...")
interface = MiMoV25ASRInterface()

init_status_msg = ""
if args.model_path or args.tokenizer_path:
print("Initializing model from command-line paths...")
print(interface.initialize_model(args.model_path, args.tokenizer_path))
init_status_msg = interface.initialize_model(args.model_path, args.tokenizer_path)
print(init_status_msg)

print("Create Gradio interface...")
iface = interface.create_interface(
default_model_path=args.model_path or "",
default_tokenizer_path=args.tokenizer_path or "",
init_status_msg=init_status_msg,
)

print(f"Launch service - {args.host}:{args.port}")
Expand Down