xray918's picture
Upload folder using huggingface_hub
0ad74ed verified
raw
history blame
994 Bytes
from gradio.components.base import Component
class Fallback(Component):
def preprocess(self, payload):
"""
This docstring is used to generate the docs for this custom component.
Parameters:
payload: the data to be preprocessed, sent from the frontend
Returns:
the data after preprocessing, sent to the user's function in the backend
"""
return payload
def postprocess(self, value):
"""
This docstring is used to generate the docs for this custom component.
Parameters:
payload: the data to be postprocessed, sent from the user's function in the backend
Returns:
the data after postprocessing, sent to the frontend
"""
return value
def example_payload(self):
return {"foo": "bar"}
def example_value(self):
return {"foo": "bar"}
def api_info(self):
return {"type": {}, "description": "any valid json"}