How to use gradio_client.submit() method to get the status and result on python?

#66
by logeshnusic - opened

Hi, How to use submit method on my python server.
The error from the below code: "ValueError: Cannot find a function with api_name: /predict"

   client = Client("https://musicgen-duplicate-name.hf.space/")
    job = client.submit(
        "melody",	# str  in 'Model' Radio component
        prompt,	# str  in 'Input Text' Textbox component
        "1.wav",	# str (filepath or URL to file) in 'File' Audio component
        1,	# int | float (numeric value between 1 and 120) in 'Duration' Slider component TODO
        250,	# int | float  in 'Top-k' Number component
        0,	# int | float  in 'Top-p' Number component
        1,	# int | float  in 'Temperature' Number component
        3,	# int | float  in 'Classifier Free Guidance' Number component
        fn_index=1,
        api_name="/predict"
    )

removing "api_name" actually works

logeshnusic changed discussion status to closed

Sign up or log in to comment