0

This is my function

import gradio as gr
import gradio.utils as gr_utils
import gradio.processing_utils as gr_processing_utils

def audio_postprocess(self, y):
    data = audio_postprocess_ori(self, y)
    if data is None:
        return None
    return gr_processing_utils.encode_url_or_file_to_base64(data["name"])

An error shows that AttributeError: module 'gradio.processing_utils' has no attribute 'encode_url_or_file_to_base64'

I'm I understand correctly that the error coming from the version of gradio package? Is it yes, what is the gradio version should I use (my current version is gradio = 3.36.1, the lastest version)

P.Chian
  • 65
  • 1
  • 7

1 Answers1

0

encode_url_or_file_to_base64 function move to gradio_client.utils

so, use it like this:

import gradio as gr
import gradio.utils as gr_utils
from gradio_client import utils as client_utils

def audio_postprocess(self, y):
    data = audio_postprocess_ori(self, y)
    if data is None:
        return None
    return client_utils.encode_url_or_file_to_base64(data["name"])