Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Commit 
							
							·
						
						d8bb336
	
1
								Parent(s):
							
							af55f1c
								
update
Browse files- app_locally.py +11 -1
 
    	
        app_locally.py
    CHANGED
    
    | 
         @@ -14,6 +14,13 @@ ckpt_converter = 'checkpoints/converter' 
     | 
|
| 14 | 
         
             
            tone_color_converter = ToneColorConverter(f'{ckpt_converter}/config.json', device=device)
         
     | 
| 15 | 
         
             
            tone_color_converter.load_ckpt(f'{ckpt_converter}/checkpoint.pth')
         
     | 
| 16 | 
         | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 17 | 
         
             
            #def predict(prompt, style, audio_file_pth, mic_file_path, use_mic, language):
         
     | 
| 18 | 
         
             
            def predict(prompt, audio_file_pth, mic_file_path, use_mic, language):
         
     | 
| 19 | 
         
             
                # initialize a empty info
         
     | 
| 
         @@ -179,7 +186,10 @@ with gr.Blocks(analytics_enabled=False) as demo: 
     | 
|
| 179 | 
         
             
                            info="Notice: Microphone input may not work properly under traffic",
         
     | 
| 180 | 
         
             
                        )
         
     | 
| 181 | 
         
             
                        #language = gr.Radio(['EN-Newest', 'EN-US', 'EN-BR', 'EN_INDIA', 'EN-AU', 'EN-Default', 'ES', 'FR', 'ZH', 'JP', 'KR'], label='Language', value='EN-Newest')
         
     | 
| 182 | 
         
            -
                         
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 183 | 
         | 
| 184 | 
         
             
                        tts_button = gr.Button("Send", elem_id="send-btn", visible=True)
         
     | 
| 185 | 
         | 
| 
         | 
|
| 14 | 
         
             
            tone_color_converter = ToneColorConverter(f'{ckpt_converter}/config.json', device=device)
         
     | 
| 15 | 
         
             
            tone_color_converter.load_ckpt(f'{ckpt_converter}/checkpoint.pth')
         
     | 
| 16 | 
         | 
| 17 | 
         
            +
             
     | 
| 18 | 
         
            +
            languages = ["EN", "ES", "FR", "ZH", "JP", "KR"]
         
     | 
| 19 | 
         
            +
            en = ["EN-Default", "EN-US", "EN-BR", "EN_INDIA", "EN-AU"]
         
     | 
| 20 | 
         
            +
             
     | 
| 21 | 
         
            +
            LANG = sys.argv[1].strip()
         
     | 
| 22 | 
         
            +
             
     | 
| 23 | 
         
            +
             
     | 
| 24 | 
         
             
            #def predict(prompt, style, audio_file_pth, mic_file_path, use_mic, language):
         
     | 
| 25 | 
         
             
            def predict(prompt, audio_file_pth, mic_file_path, use_mic, language):
         
     | 
| 26 | 
         
             
                # initialize a empty info
         
     | 
| 
         | 
|
| 186 | 
         
             
                            info="Notice: Microphone input may not work properly under traffic",
         
     | 
| 187 | 
         
             
                        )
         
     | 
| 188 | 
         
             
                        #language = gr.Radio(['EN-Newest', 'EN-US', 'EN-BR', 'EN_INDIA', 'EN-AU', 'EN-Default', 'ES', 'FR', 'ZH', 'JP', 'KR'], label='Language', value='EN-Newest')
         
     | 
| 189 | 
         
            +
                        if LANG == "EN":
         
     | 
| 190 | 
         
            +
                            language = gr.Radio(['EN-US', 'EN-BR', 'EN_INDIA', 'EN-AU', 'EN-Default'], label='Language', value='EN-US')
         
     | 
| 191 | 
         
            +
                        else:
         
     | 
| 192 | 
         
            +
                            language = gr.Radio([LANG], value=LANG)
         
     | 
| 193 | 
         | 
| 194 | 
         
             
                        tts_button = gr.Button("Send", elem_id="send-btn", visible=True)
         
     | 
| 195 | 
         |