voice / main.py
Altadmin's picture
Upload 38 files
890b83f
raw
history blame
994 Bytes
import functions_framework
import os
import logging
@functions_framework.http
def hello_http(request):
request_args = request.args
# Extract parameters from request
audio_file = request_args.get('audio_file')
model_name = request_args.get('model_name')
transform = request_args.get('transform')
song = request_args.get('song')
# Check if any parameter is None
if any(param is None for param in [audio_file, model_name, transform, song]):
return "Please provide all the required arguments: audio_file, model_name, transform, song."
else:
is_song = song.lower() == "true"
transform = int(transform)
import RVC_class
is_song = song.lower() == "true"
# Create an instance of VoiceConverter
converter = RVC_class.VoiceConverter()
# Call single_run method and get the result
result = converter.single_run(audio_file, model_name, transform, is_song)
return result