CoolFace
Datasetpublic

gradio/frontend

sourceHugging Faceupdated 1h agoView on Hugging Face
1likes413kdownloads
test_data.ts563 linesDownload Raw Back to test
1// @ts-nocheck2import { ApiData, ApiInfo, Config, EndpointInfo } from "../types";3 4export const runtime_response = {5	stage: "RUNNING",6	hardware: {7		current: "cpu-basic",8		requested: "cpu-basic"9	},10	storage: {11		current: null,12		requested: null13	},14	gcTimeout: 86400,15	replicas: {16		current: 1,17		requested: 118	},19	devMode: false,20	domains: [21		{22			domain: "hmb-hello-world.hf.space",23			isCustom: false,24			stage: "READY"25		}26	]27};28 29export const transformed_api_info: ApiInfo<ApiData> = {30	named_endpoints: {31		"/predict": {32			parameters: [33				{34					label: "name",35					type: "string",36					python_type: { type: "str", description: "" },37					component: "Textbox",38					example_input: "Hello!!"39				}40			],41			returns: [42				{43					label: "output",44					type: "string",45					python_type: { type: "str", description: "" },46					component: "Textbox"47				}48			],49			type: { generator: false, cancel: false }50		}51	},52	unnamed_endpoints: {53		"0": {54			parameters: [55				{56					label: "name",57					type: "string",58					python_type: { type: "str", description: "" },59					component: "Textbox",60					example_input: "Hello!!"61				}62			],63			returns: [64				{65					label: "output",66					type: "string",67					python_type: { type: "str", description: "" },68					component: "Textbox"69				}70			],71			type: { generator: false, cancel: false }72		}73	}74};75 76export const response_api_info: ApiInfo<ApiData> = {77	named_endpoints: {78		"/predict": {79			parameters: [80				{81					label: "name",82					type: {83						type: "string"84					},85					python_type: {86						type: "str",87						description: ""88					},89					component: "Textbox",90					example_input: "Hello!!"91				}92			],93			returns: [94				{95					label: "output",96					type: {97						type: "string"98					},99					python_type: {100						type: "str",101						description: ""102					},103					component: "Textbox"104				}105			]106		}107	},108	unnamed_endpoints: {}109};110 111export const config_response: Config = {112	version: "4.27.0",113	mode: "interface",114	app_id: 123,115	dev_mode: false,116	analytics_enabled: true,117	components: [118		{119			id: 3,120			type: "row",121			props: {122				variant: "default",123				visible: true,124				equal_height: false,125				name: "row"126			},127			skip_api: true,128			component_class_id: ""129		},130		{131			id: 4,132			type: "column",133			props: {134				scale: 1,135				min_width: 320,136				variant: "panel",137				visible: true,138				name: "column"139			},140			skip_api: true,141			component_class_id: ""142		},143		{144			id: 5,145			type: "column",146			props: {147				scale: 1,148				min_width: 320,149				variant: "default",150				visible: true,151				name: "column"152			},153			skip_api: true,154			component_class_id: ""155		},156		{157			id: 1,158			type: "textbox",159			props: {160				lines: 1,161				max_lines: 20,162				label: "name",163				show_label: true,164				container: true,165				min_width: 160,166				visible: true,167				autofocus: false,168				autoscroll: true,169				elem_classes: [],170				type: "text",171				rtl: false,172				show_copy_button: false,173				name: "textbox",174				_selectable: false175			},176			skip_api: false,177			component_class_id: "",178			api_info: {179				type: "string"180			},181			example_inputs: "Hello!!"182		},183		{184			id: 6,185			type: "form",186			props: {187				scale: 0,188				min_width: 0,189				name: "form"190			},191			skip_api: true,192			component_class_id: ""193		},194		{195			id: 7,196			type: "row",197			props: {198				variant: "default",199				visible: true,200				equal_height: true,201				name: "row"202			},203			skip_api: true,204			component_class_id: ""205		},206		{207			id: 8,208			type: "button",209			props: {210				value: "Clear",211				variant: "secondary",212				visible: true,213				interactive: true,214				elem_classes: [],215				api_visibility: "undocumented",216				name: "button",217				_selectable: false218			},219			skip_api: true,220			component_class_id: ""221		},222		{223			id: 9,224			type: "button",225			props: {226				value: "Submit",227				variant: "primary",228				visible: true,229				interactive: true,230				elem_classes: [],231				name: "button",232				_selectable: false233			},234			skip_api: true,235			component_class_id: ""236		},237		{238			id: 10,239			type: "column",240			props: {241				scale: 1,242				min_width: 320,243				variant: "panel",244				visible: true,245				name: "column"246			},247			skip_api: true,248			component_class_id: ""249		},250		{251			id: 2,252			type: "textbox",253			props: {254				lines: 1,255				max_lines: 20,256				label: "output",257				show_label: true,258				container: true,259				min_width: 160,260				interactive: false,261				visible: true,262				autofocus: false,263				autoscroll: true,264				elem_classes: [],265				type: "text",266				rtl: false,267				show_copy_button: false,268				name: "textbox",269				_selectable: false270			},271			skip_api: false,272			component_class_id: "",273			api_info: {274				type: "string"275			},276			example_inputs: "Hello!!"277		},278		{279			id: 11,280			type: "row",281			props: {282				variant: "default",283				visible: true,284				equal_height: true,285				name: "row"286			},287			skip_api: true,288			component_class_id: ""289		},290		{291			id: 12,292			type: "form",293			props: {294				scale: 0,295				min_width: 0,296				name: "form"297			},298			skip_api: true,299			component_class_id: ""300		}301	],302	css: null,303	js: null,304	head: null,305	title: "Gradio",306	space_id: "hmb/hello_world",307	enable_queue: true,308	show_error: false,309	footer_links: ["api", "gradio", "settings"],310	is_colab: false,311	stylesheets: [],312	theme: "default",313	protocol: "sse_v3",314	body_css: {315		body_background_fill: "white",316		body_text_color: "#1f2937",317		body_background_fill_dark: "#0b0f19",318		body_text_color_dark: "#f3f4f6"319	},320	fill_height: false,321	layout: {322		id: 0,323		children: [324			{325				id: 3,326				children: [327					{328						id: 4,329						children: [330							{331								id: 5,332								children: [333									{334										id: 6,335										children: [336											{337												id: 1338											}339										]340									}341								]342							},343							{344								id: 7,345								children: [346									{347										id: 8348									},349									{350										id: 9351									}352								]353							}354						]355					},356					{357						id: 10,358						children: [359							{360								id: 12,361								children: [362									{363										id: 2364									}365								]366							},367							{368								id: 11,369								children: []370							}371						]372					}373				]374			}375		]376	},377	dependencies: [378		{379			id: 0,380			targets: [381				[9, "click"],382				[1, "submit"]383			],384			inputs: [1],385			outputs: [2],386			backend_fn: true,387			js: null,388			queue: null,389			api_name: "predict",390			scroll_to_output: false,391			show_progress: "full",392			every: null,393			batch: false,394			max_batch_size: 4,395			cancels: [],396			types: {397				generator: false,398				cancel: false399			},400			collects_event_data: false,401			trigger_after: null,402			trigger_only_on_success: false,403			trigger_only_on_failure: false,404			trigger_mode: "once",405			api_visibility: "public",406			zerogpu: false407		},408		{409			id: 1,410			targets: [[8, "click"]],411			inputs: [],412			outputs: [1, 2],413			backend_fn: false,414			js: "() => [null, null]",415			queue: false,416			api_name: "js_fn",417			scroll_to_output: false,418			show_progress: "full",419			every: null,420			batch: false,421			max_batch_size: 4,422			cancels: [],423			types: {424				generator: false,425				cancel: false426			},427			collects_event_data: false,428			trigger_after: null,429			trigger_only_on_success: false,430			trigger_only_on_failure: false,431			trigger_mode: "once",432			api_visibility: "private",433			zerogpu: false434		},435		{436			id: 2,437			targets: [[8, "click"]],438			inputs: [],439			outputs: [5],440			backend_fn: false,441			js: '() => [{"variant": null, "visible": true, "__type__": "update"}]\n            ',442			queue: false,443			api_name: "js_fn_1",444			scroll_to_output: false,445			show_progress: "full",446			every: null,447			batch: false,448			max_batch_size: 4,449			cancels: [],450			types: {451				generator: false,452				cancel: false453			},454			collects_event_data: false,455			trigger_after: null,456			trigger_only_on_success: false,457			trigger_only_on_failure: false,458			trigger_mode: "once",459			api_visibility: "private",460			zerogpu: false461		}462	],463	root: "https://hmb-hello-world.hf.space",464	path: ""465};466 467export const whoami_response = {468	type: "user",469	id: "123",470	name: "hmb",471	fullname: "jerry",472	email: "jerry@gradio.com",473	emailVerified: true,474	canPay: true,475	periodEnd: 123,476	isPro: false,477	avatarUrl: "",478	orgs: [],479	auth: {480		type: "access_token",481		accessToken: {482			displayName: "Gradio Client",483			role: "write"484		}485	}486};487 488export const duplicate_response = {489	url: "https://huggingface.co/spaces/hmb/hello_world"490};491 492export const hardware_sleeptime_response = {493	stage: "RUNNING",494	hardware: {495		current: "cpu-basic",496		requested: "cpu-upgrade"497	},498	storage: null,499	gcTimeout: 300,500	replicas: {501		current: 1,502		requested: 1503	},504	devMode: false,505	domains: [506		{507			domain: "hmb-hello-world.hf.space",508			isCustom: false,509			stage: "READY"510		}511	]512};513 514export const endpoint_info: EndpointInfo<ApiData> = {515	parameters: [516		{517			label: "parameter_2",518			parameter_name: "im",519			parameter_has_default: false,520			parameter_default: null,521			type: "",522			python_type: {523				type: "Dict(background: filepath | None, layers: List[filepath], composite: filepath | None, id: str | None)",524				description: ""525			},526			component: "Imageeditor",527			example_input: {528				background: {529					path: "",530					meta: {531						_type: "gradio.FileData"532					},533					orig_name: "bus.png",534					url: ""535				},536				layers: [],537				composite: null538			}539		}540	],541	returns: [542		{543			label: "value_3",544			type: "string",545			python_type: {546				type: "filepath",547				description: ""548			},549			component: "Image"550		}551	],552	type: {553		generator: false554	}555};556 557export const discussions_response = {558	discussions: [],559	count: 0,560	start: 0,561	numClosedDiscussions: 0562};563 
gradio/frontend · CoolFace