Spaces:
Sleeping
Sleeping
Download testhandler.py from smjain/Advanced-RVC-Inference: direct link, hf CLI and curl.
- Browser
- Download file 956 Bytes
-
https://huggingface.co/spaces/smjain/Advanced-RVC-Inference/resolve/d6f668bc104a1a290b96fe97d8d1be710d0e94b1/testhandler.py
- Command line
-
hf download hf://spaces/smjain/Advanced-RVC-Inference@d6f668bc104a1a290b96fe97d8d1be710d0e94b1/testhandler.py
-
curl -L -o testhandler.py https://huggingface.co/spaces/smjain/Advanced-RVC-Inference/resolve/d6f668bc104a1a290b96fe97d8d1be710d0e94b1/testhandler.py
956 Bytes
| import torch | |
| import os | |
| import traceback | |
| import sys | |
| import warnings | |
| import shutil | |
| import numpy as np | |
| import infer_new | |
| def main(): | |
| try: | |
| print("Inside main function ********") | |
| # Setup your parameters here | |
| spk_id = "modi.pth" | |
| voice_transform = 0 | |
| input_audio_path = "test.mp3" | |
| # Call the api_convert_voice function from infer_new.py | |
| # Ensure that infer_new.py is correctly implemented to handle this function call | |
| output_path = infer_new.api_convert_voice(spk_id, voice_transform, input_audio_path) | |
| print(f"Processed audio file is located at: {output_path}") | |
| # Depending on your needs, you can return or print any results here | |
| print(f"Hello, ! The processed audio file is located at: {output_path}") | |
| except Exception as e: | |
| print("An error occurred:", e) | |
| traceback.print_exc() | |
| if __name__ == "__main__": | |
| main() | |