MOSS-Speech / app.py
singularitys0's picture
Update app.py
22c3b30 verified
raw
history blame
985 Bytes
#!/usr/bin/env python3
"""
Moss Speech Demo - Multimodal Speech Interaction System
Main Program Entry
"""
import spaces
import argparse
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
sys.path.append("/home/user/app/Matcha-TTS")
from utils.interface import MIMOInterface
@spaces.GPU(duration=1)
def keep_spaces_happy():
pass
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",
)
return parser.parse_args()
def main():
args = parse_args()
# create demo
interface = MIMOInterface(args.model_path)
demo = interface.create_interface()
demo.launch()
if __name__ == "__main__":
main()