mirror of
https://github.com/Ladebeze66/projetcbaollm.git
synced 2025-12-16 20:37:50 +01:00
33 lines
994 B
Python
33 lines
994 B
Python
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"}
|