lite_metadata: | |
gradio_version: 3.32.0 | |
liteobj_version: 0.0.7 | |
class_string: gradio.interface.Interface | |
kwargs: | |
title: gitio app | |
description: 'Let the user draw two figures, circle, rectangle or square and compute | |
the total area ' | |
article: null | |
thumbnail: null | |
theme: gradio/seafoam | |
css: null | |
allow_flagging: never | |
inputs: | |
- class_string: gradio.components.Dataframe | |
kwargs: | |
label: shapes | |
type: array | |
- class_string: gradio.components.Dataframe | |
kwargs: | |
label: dimensions | |
type: array | |
outputs: | |
- class_string: gradio.components.Number | |
kwargs: | |
label: output | |
fn: | |
class_string: gradify.gradify_closure | |
kwargs: | |
argmaps: | |
- label: shapes | |
postprocessing: 'lambda array: list(map(str, array[0]))' | |
- label: dimensions | |
postprocessing: 'lambda array: list(map(float, array[0]))' | |
func_kwargs: {} | |
source: "import math\n\n\ndef calculate_area(shapes, dimensions):\n total_area\ | |
\ = 0\n for i in range(len(shapes)):\n if shapes[i] == 'circle':\n\ | |
\ total_area += math.pi * dimensions[i] ** 2\n elif shapes[i]\ | |
\ == 'rectangle':\n total_area += dimensions[i] * dimensions[i\ | |
\ + 1]\n elif shapes[i] == 'square':\n total_area += dimensions[i]\ | |
\ ** 2\n return total_area" | |