File size: 1,376 Bytes
f5abf67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python3
"""
Moss Speech Demo - Multimodal Speech Interaction System 
Main Program Entry
"""

import argparse
import os
import sys

sys.path.append(os.path.dirname(os.path.abspath(__file__)))

from utils.interface import MIMOInterface


def parse_args():
    parser = argparse.ArgumentParser(description="Moss Speech Demo")
    parser.add_argument(
        "--model_path",
        type=str,
        default="fnlp/MOSS-Speech",
        help="the path of model",
    )
    parser.add_argument(
        '--codec_path',
        type=str,
        default='fnlp/MOSS-Speech-Codec'
        help="the path of codec",
    )
    parser.add_argument("--host", type=str, default="0.0.0.0", help="server address")
    parser.add_argument("--port", type=int, default=7860, help="server port")
    parser.add_argument("--share", action="store_true", help="cweather reate a public link")
    return parser.parse_args()


def main():
    args = parse_args()

    # create demo
    interface = MIMOInterface(args.model_path)
    demo = interface.create_interface()

    print(f"πŸš€ running Moss Speech Demo...")
    print(f"πŸ“± model path: {args.model_path}")
    print(f"🌐 server link: http://{args.host}:{args.port}")
    
    demo.launch(
        server_name=args.host,
        server_port=args.port,
        share=args.share
    )


if __name__ == "__main__":
    main()