import torch from TTS.api import TTS import gradio as gr device="cuda" if torch.cuda.is_available() else "cpu" tts=TTS(model_name="voice_conversion_models/multilingual/vctk/freevc24",progress_bar=False).to(device) path="output.wav" def VoiceClone(source_voice,Target_Voice): return tts.voice_conversion_to_file(source_wav=source_voice, target_wav=Target_Voice, file_path=path) interface=gr.Interface(fn=VoiceClone,inputs=[gr.Audio(label="upload and record source audio file",type="filepath"),gr.Audio(label="Upload and record target audio file",type="filepath")], outputs=[gr.Audio(type="filepath")], title="Abdul Rehman Voice Cloning and Conversion Tool", description="Change your voice into Target voice tone") interface.launch(debug=True)