API documentation
https://liuhaotian-llava-1-6.hf.space/--replicas/z1wes/
11 API endpoints

Use the gradio_client Python library or the @gradio/client Javascript package to query the demo via API.

copy
$ pip install gradio_client
Endpoints
api_name: /upvote_last_response
copy
from gradio_client import Client

client = Client("https://liuhaotian-llava-1-6.hf.space/--replicas/z1wes/")
result = client.predict(
		null,	# Literal[]  in 'parameter_10' Dropdown component
		api_name="/upvote_last_response"
)
print(result)
Return Type(s)
# str representing output in 'value_3' Textbox component
api_name: /downvote_last_response
copy
from gradio_client import Client

client = Client("https://liuhaotian-llava-1-6.hf.space/--replicas/z1wes/")
result = client.predict(
		null,	# Literal[]  in 'parameter_10' Dropdown component
		api_name="/downvote_last_response"
)
print(result)
Return Type(s)
# str representing output in 'value_3' Textbox component
api_name: /flag_last_response
copy
from gradio_client import Client

client = Client("https://liuhaotian-llava-1-6.hf.space/--replicas/z1wes/")
result = client.predict(
		null,	# Literal[]  in 'parameter_10' Dropdown component
		api_name="/flag_last_response"
)
print(result)
Return Type(s)
# str representing output in 'value_3' Textbox component
api_name: /regenerate
copy
from gradio_client import Client

client = Client("https://liuhaotian-llava-1-6.hf.space/--replicas/z1wes/")
result = client.predict(
		"Crop",	# Literal['Crop', 'Resize', 'Pad', 'Default']  in 'Preprocess for non-square image' Radio component
		api_name="/regenerate"
)
print(result)
Return Type(s)
(
# Tuple[str | Dict(file: filepath, alt_text: str | None) | None, str | Dict(file: filepath, alt_text: str | None) | None] representing output in 'LLaVA Chatbot' Chatbot component,
# str representing output in 'value_3' Textbox component,
# filepath representing output in 'value_11' Image component,
)
api_name: /http_bot
copy
from gradio_client import Client

client = Client("https://liuhaotian-llava-1-6.hf.space/--replicas/z1wes/")
result = client.predict(
		null,	# Literal[]  in 'parameter_10' Dropdown component
		0,	# float (numeric value between 0.0 and 1.0) in 'Temperature' Slider component
		0,	# float (numeric value between 0.0 and 1.0) in 'Top P' Slider component
		0,	# float (numeric value between 0 and 1024) in 'Max output tokens' Slider component
		api_name="/http_bot"
)
print(result)
Return Type(s)
# Tuple[str | Dict(file: filepath, alt_text: str | None) | None, str | Dict(file: filepath, alt_text: str | None) | None] representing output in 'LLaVA Chatbot' Chatbot component
api_name: /clear_history
copy
from gradio_client import Client

client = Client("https://liuhaotian-llava-1-6.hf.space/--replicas/z1wes/")
result = client.predict(
		api_name="/clear_history"
)
print(result)
Return Type(s)
(
# Tuple[str | Dict(file: filepath, alt_text: str | None) | None, str | Dict(file: filepath, alt_text: str | None) | None] representing output in 'LLaVA Chatbot' Chatbot component,
# str representing output in 'value_3' Textbox component,
# filepath representing output in 'value_11' Image component,
)
api_name: /add_text
copy
from gradio_client import Client

client = Client("https://liuhaotian-llava-1-6.hf.space/--replicas/z1wes/")
result = client.predict(
		"Hello!!",	# str  in 'parameter_3' Textbox component
		"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png",	# filepath  in 'parameter_11' Image component
		"Crop",	# Literal['Crop', 'Resize', 'Pad', 'Default']  in 'Preprocess for non-square image' Radio component
		api_name="/add_text"
)
print(result)
Return Type(s)
(
# Tuple[str | Dict(file: filepath, alt_text: str | None) | None, str | Dict(file: filepath, alt_text: str | None) | None] representing output in 'LLaVA Chatbot' Chatbot component,
# str representing output in 'value_3' Textbox component,
# filepath representing output in 'value_11' Image component,
)
api_name: /http_bot_1
copy
from gradio_client import Client

client = Client("https://liuhaotian-llava-1-6.hf.space/--replicas/z1wes/")
result = client.predict(
		null,	# Literal[]  in 'parameter_10' Dropdown component
		0,	# float (numeric value between 0.0 and 1.0) in 'Temperature' Slider component
		0,	# float (numeric value between 0.0 and 1.0) in 'Top P' Slider component
		0,	# float (numeric value between 0 and 1024) in 'Max output tokens' Slider component
		api_name="/http_bot_1"
)
print(result)
Return Type(s)
# Tuple[str | Dict(file: filepath, alt_text: str | None) | None, str | Dict(file: filepath, alt_text: str | None) | None] representing output in 'LLaVA Chatbot' Chatbot component
api_name: /add_text_1
copy
from gradio_client import Client

client = Client("https://liuhaotian-llava-1-6.hf.space/--replicas/z1wes/")
result = client.predict(
		"Hello!!",	# str  in 'parameter_3' Textbox component
		"https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png",	# filepath  in 'parameter_11' Image component
		"Crop",	# Literal['Crop', 'Resize', 'Pad', 'Default']  in 'Preprocess for non-square image' Radio component
		api_name="/add_text_1"
)
print(result)
Return Type(s)
(
# Tuple[str | Dict(file: filepath, alt_text: str | None) | None, str | Dict(file: filepath, alt_text: str | None) | None] representing output in 'LLaVA Chatbot' Chatbot component,
# str representing output in 'value_3' Textbox component,
# filepath representing output in 'value_11' Image component,
)
api_name: /http_bot_2
copy
from gradio_client import Client

client = Client("https://liuhaotian-llava-1-6.hf.space/--replicas/z1wes/")
result = client.predict(
		null,	# Literal[]  in 'parameter_10' Dropdown component
		0,	# float (numeric value between 0.0 and 1.0) in 'Temperature' Slider component
		0,	# float (numeric value between 0.0 and 1.0) in 'Top P' Slider component
		0,	# float (numeric value between 0 and 1024) in 'Max output tokens' Slider component
		api_name="/http_bot_2"
)
print(result)
Return Type(s)
# Tuple[str | Dict(file: filepath, alt_text: str | None) | None, str | Dict(file: filepath, alt_text: str | None) | None] representing output in 'LLaVA Chatbot' Chatbot component
api_name: /load_demo_refresh_model_list
copy
from gradio_client import Client

client = Client("https://liuhaotian-llava-1-6.hf.space/--replicas/z1wes/")
result = client.predict(
		api_name="/load_demo_refresh_model_list"
)
print(result)
Return Type(s)
# Literal[] representing output in 'value_10' Dropdown component