apiname: /predict copy from gradioclient import Client client =…
- User
api_name: /predict copy from gradio_client import Client
client = Client("yuntian-deng/ChatGPT") result = client.predict( inputs="Hello!!", top_p=1, temperature=1, chat_counter=0, chatbot=[], api_name="/predict" ) print(result) Accepts 5 parameters: inputs str Required
The input value that is provided in the "Type an input and press Enter" Textbox component.
top_p float Default: 1
The input value that is provided in the "Top-p (nucleus sampling)" Slider component.
temperature float Default: 1
The input value that is provided in the "Temperature" Slider component.
chat_counter float Default: 0
The input value that is provided in the "parameter_16" Number component.
chatbot Tuple[str | Dict(file: filepath, alt_text: str | None) | Dict(component: str, value: Any, constructor_args: Dict(), props: Dict()) | None, str | Dict(file: filepath, alt_text: str | None) | Dict(component: str, value: Any, constructor_args: Dict(), props: Dict()) | None] Default: []
The input value that is provided in the "parameter_4" Chatbot component.
Returns tuple of 4 elements [0] Tuple[str | Dict(file: filepath, alt_text: str | None) | Dict(component: str, value: Any, constructor_args: Dict(), props: Dict()) | None, str | Dict(file: filepath, alt_text: str | None) | Dict(component: str, value: Any, constructor_args: Dict(), props: Dict()) | None]
The output value that appears in the "value_4" Chatbot component.
[1] float
The output value that appears in the "value_16" Number component.
[2] str
The output value that appears in the "Status code from
- Assistant
the API call".
[3] str
The output value that appears in the "message" component, providing additional information about the response.
Example Usage of the API
The following code snippet demonstrates how to use the
/predictAPI from the Gradio client you provided: