Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | 
         @@ -29,13 +29,17 @@ def init(): 
     | 
|
| 29 | 
         
             
            def new_load_mod(instr="en_US-joe-medium"):
         
     | 
| 30 | 
         
             
                    model=instr
         
     | 
| 31 | 
         
             
                    print(f"model: {model}")
         
     | 
| 32 | 
         
            -
                    lang=instr.split("_")[0]
         
     | 
| 
         | 
|
| 33 | 
         
             
                    print(f"lang: {lang}")
         
     | 
| 34 | 
         
            -
                    dia=instr.split("-")[0]
         
     | 
| 
         | 
|
| 35 | 
         
             
                    print(f"dia: {dia}")
         
     | 
| 36 | 
         
            -
                    name=instr.split("-")[1]
         
     | 
| 
         | 
|
| 37 | 
         
             
                    print(f"name: {name}")
         
     | 
| 38 | 
         
            -
                    style=instr.split("-")[2]
         
     | 
| 
         | 
|
| 39 | 
         
             
                    print(f"style: {style}")
         
     | 
| 40 | 
         
             
                    file=f'{instr}.onnx'
         
     | 
| 41 | 
         
             
                    print(f"file: {file}")
         
     | 
| 
         @@ -43,8 +47,8 @@ def new_load_mod(instr="en_US-joe-medium"): 
     | 
|
| 43 | 
         
             
                    print(f"os.path: {os.path}")
         
     | 
| 44 | 
         
             
                    if not os.path.isfile(f'{os.getcwd()}/voices/{file}'):
         
     | 
| 45 | 
         
             
                        print(f"Model not found locally")
         
     | 
| 46 | 
         
            -
                        m_path= f"https://huggingface.co/rhasspy/piper-voices/resolve/main/{lang}/{dia}/{name}/{style}/{file}"
         
     | 
| 47 | 
         
            -
                         
     | 
| 48 | 
         
             
                        print(f"m_path: {m_path}")
         
     | 
| 49 | 
         
             
                        print("Downloading json...")
         
     | 
| 50 | 
         
             
                        json_file=requests.get(f"{m_path}.json")
         
     | 
| 
         | 
|
| 29 | 
         
             
            def new_load_mod(instr="en_US-joe-medium"):
         
     | 
| 30 | 
         
             
                    model=instr
         
     | 
| 31 | 
         
             
                    print(f"model: {model}")
         
     | 
| 32 | 
         
            +
                    # lang=instr.split("_")[0]
         
     | 
| 33 | 
         
            +
                    lang="lb"
         
     | 
| 34 | 
         
             
                    print(f"lang: {lang}")
         
     | 
| 35 | 
         
            +
                    # dia=instr.split("-")[0]
         
     | 
| 36 | 
         
            +
                    dia="lb_LU"
         
     | 
| 37 | 
         
             
                    print(f"dia: {dia}")
         
     | 
| 38 | 
         
            +
                    # name=instr.split("-")[1]
         
     | 
| 39 | 
         
            +
                    name="female2"
         
     | 
| 40 | 
         
             
                    print(f"name: {name}")
         
     | 
| 41 | 
         
            +
                    # style=instr.split("-")[2]
         
     | 
| 42 | 
         
            +
                    style="medium"
         
     | 
| 43 | 
         
             
                    print(f"style: {style}")
         
     | 
| 44 | 
         
             
                    file=f'{instr}.onnx'
         
     | 
| 45 | 
         
             
                    print(f"file: {file}")
         
     | 
| 
         | 
|
| 47 | 
         
             
                    print(f"os.path: {os.path}")
         
     | 
| 48 | 
         
             
                    if not os.path.isfile(f'{os.getcwd()}/voices/{file}'):
         
     | 
| 49 | 
         
             
                        print(f"Model not found locally")
         
     | 
| 50 | 
         
            +
                        # m_path= f"https://huggingface.co/rhasspy/piper-voices/resolve/main/{lang}/{dia}/{name}/{style}/{file}"
         
     | 
| 51 | 
         
            +
                        m_path= f"https://huggingface.co/mbarnig/lb_rhasspy_piper_female_tts/resolve/main/female2_model.onnx"
         
     | 
| 52 | 
         
             
                        print(f"m_path: {m_path}")
         
     | 
| 53 | 
         
             
                        print("Downloading json...")
         
     | 
| 54 | 
         
             
                        json_file=requests.get(f"{m_path}.json")
         
     |