Spaces:
				
			
			
	
			
			
					
		Running
		
	
	
	
			
			
	
	
	
	
		
		
					
		Running
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 | 
             
            # Copyright (c) 2023 Amphion.
         | 
| 2 | 
             
            #
         | 
| 3 | 
             
            # This source code is licensed under the MIT license found in the
         | 
| 4 | 
            -
            # LICENSE file in the root directory of this source tree | 
| 5 |  | 
| 6 | 
             
            import subprocess
         | 
| 7 |  | 
| @@ -19,16 +19,16 @@ import os | |
| 19 | 
             
            import inference
         | 
| 20 |  | 
| 21 | 
             
            SUPPORTED_SPEAKERS = {
         | 
| 22 | 
            -
                " | 
| 23 | 
            -
                " | 
| 24 | 
            -
                " | 
| 25 | 
            -
                " | 
| 26 | 
            -
                " | 
| 27 | 
            -
                " | 
| 28 | 
            -
                " | 
| 29 | 
            -
                " | 
| 30 | 
            -
                " | 
| 31 | 
            -
                " | 
| 32 | 
             
            }
         | 
| 33 |  | 
| 34 |  | 
| @@ -36,9 +36,11 @@ def tts_inference( | |
| 36 | 
             
                input_text,
         | 
| 37 | 
             
                target_speaker
         | 
| 38 | 
             
            ):
         | 
| 39 | 
            -
             | 
|  | |
|  | |
| 40 | 
             
                args_list = ["--config", "./egs/tts/vits_hifitts/exp_config.json"]
         | 
| 41 | 
            -
                args_list += ["--checkpoint_path", "./latest-checkpoint"]
         | 
| 42 | 
             
                args_list += ["--speaker_name", target_speaker]
         | 
| 43 | 
             
                args_list += ["--text", input_text]
         | 
| 44 | 
             
                args_list += ["--mode","single"]
         | 
| @@ -50,7 +52,7 @@ def tts_inference( | |
| 50 |  | 
| 51 | 
             
                ### Display ###
         | 
| 52 | 
             
                result_file = os.path.join(
         | 
| 53 | 
            -
                    "result/ | 
| 54 | 
             
                )
         | 
| 55 | 
             
                return result_file
         | 
| 56 |  | 
|  | |
| 1 | 
             
            # Copyright (c) 2023 Amphion.
         | 
| 2 | 
             
            #
         | 
| 3 | 
             
            # This source code is licensed under the MIT license found in the
         | 
| 4 | 
            +
            # LICENSE file in the root directory of this source tree
         | 
| 5 |  | 
| 6 | 
             
            import subprocess
         | 
| 7 |  | 
|  | |
| 19 | 
             
            import inference
         | 
| 20 |  | 
| 21 | 
             
            SUPPORTED_SPEAKERS = {
         | 
| 22 | 
            +
                "Cori Samuel":"hifitts_92",
         | 
| 23 | 
            +
                "Phil Benson":"hifitts_6097",
         | 
| 24 | 
            +
                "John Van Stan":"hifitts_6670",
         | 
| 25 | 
            +
                "Mike Pelton":"hifitts_6671",
         | 
| 26 | 
            +
                "Tony Oliva":"hifitts_8051",
         | 
| 27 | 
            +
                "Maria Kasper":"hifitts_9017",
         | 
| 28 | 
            +
                "Helen Taylor":"hifitts_9136",
         | 
| 29 | 
            +
                "Sylviamb":"hifitts_11614", 
         | 
| 30 | 
            +
                "Celine Major":"hifitts_11697",
         | 
| 31 | 
            +
                "LikeManyWaters":"hifitts_12787" 
         | 
| 32 | 
             
            }
         | 
| 33 |  | 
| 34 |  | 
|  | |
| 36 | 
             
                input_text,
         | 
| 37 | 
             
                target_speaker
         | 
| 38 | 
             
            ):
         | 
| 39 | 
            +
                ### Target Speaker ###
         | 
| 40 | 
            +
                target_speaker = SUPPORTED_SPEAKERS[target_speaker]
         | 
| 41 | 
            +
                
         | 
| 42 | 
             
                args_list = ["--config", "./egs/tts/vits_hifitts/exp_config.json"]
         | 
| 43 | 
            +
                args_list += ["--checkpoint_path", "./ckpt/latest-checkpoint"]
         | 
| 44 | 
             
                args_list += ["--speaker_name", target_speaker]
         | 
| 45 | 
             
                args_list += ["--text", input_text]
         | 
| 46 | 
             
                args_list += ["--mode","single"]
         | 
|  | |
| 52 |  | 
| 53 | 
             
                ### Display ###
         | 
| 54 | 
             
                result_file = os.path.join(
         | 
| 55 | 
            +
                    "result/single/test_pred.wav"
         | 
| 56 | 
             
                )
         | 
| 57 | 
             
                return result_file
         | 
| 58 |  | 
