Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -90,7 +90,10 @@ def generate_base(subject, setting): | |
| 90 | 
             
                description = "Jenny speaks at an average pace with a calm delivery in a very confined sounding environment with clear audio quality."
         | 
| 91 | 
             
                story_tokens = prompt_tokenizer(model_input_tokens, return_tensors="pt", padding=True).to(device)
         | 
| 92 | 
             
                description_tokens = description_tokenizer([description for _ in range(len(model_input_tokens))], return_tensors="pt").to(device)
         | 
| 93 | 
            -
             | 
|  | |
|  | |
|  | |
| 94 | 
             
                speech_output = [output.cpu().numpy() for output in speech_output]
         | 
| 95 | 
             
                gr.Info("Generated Audio")
         | 
| 96 | 
             
                return None, None, {"audio": speech_output, "text": model_input_tokens}
         | 
|  | |
| 90 | 
             
                description = "Jenny speaks at an average pace with a calm delivery in a very confined sounding environment with clear audio quality."
         | 
| 91 | 
             
                story_tokens = prompt_tokenizer(model_input_tokens, return_tensors="pt", padding=True).to(device)
         | 
| 92 | 
             
                description_tokens = description_tokenizer([description for _ in range(len(model_input_tokens))], return_tensors="pt").to(device)
         | 
| 93 | 
            +
                speech_output = model.generate(input_ids=description_tokens.input_ids,
         | 
| 94 | 
            +
                                               prompt_input_ids=story_tokens.input_ids,
         | 
| 95 | 
            +
                                               attention_mask=description_tokens.attention_mask,
         | 
| 96 | 
            +
                                               prompt_attention_mask=story_tokens.attention_mask)
         | 
| 97 | 
             
                speech_output = [output.cpu().numpy() for output in speech_output]
         | 
| 98 | 
             
                gr.Info("Generated Audio")
         | 
| 99 | 
             
                return None, None, {"audio": speech_output, "text": model_input_tokens}
         | 
 
			

