File size: 994 Bytes
890b83f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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