Upload folder using huggingface_hub
Browse files
demo.yaml
CHANGED
@@ -4,25 +4,38 @@ lite_metadata:
|
|
4 |
class_string: gradio.interface.Interface
|
5 |
kwargs:
|
6 |
title: gitio app
|
7 |
-
description: '
|
|
|
8 |
article: null
|
9 |
thumbnail: null
|
10 |
theme: gradio/seafoam
|
11 |
css: null
|
12 |
allow_flagging: never
|
13 |
inputs:
|
14 |
-
- class_string: gradio.components.
|
15 |
kwargs:
|
16 |
-
label:
|
|
|
|
|
|
|
|
|
|
|
17 |
outputs:
|
18 |
-
- class_string: gradio.components.
|
19 |
kwargs:
|
20 |
label: output
|
21 |
fn:
|
22 |
class_string: gradify.gradify_closure
|
23 |
kwargs:
|
24 |
argmaps:
|
25 |
-
- label:
|
26 |
-
postprocessing:
|
|
|
|
|
27 |
func_kwargs: {}
|
28 |
-
source: "
|
|
|
|
|
|
|
|
|
|
|
|
4 |
class_string: gradio.interface.Interface
|
5 |
kwargs:
|
6 |
title: gitio app
|
7 |
+
description: 'Let the user draw two figures, circle, rectangle or square and compute
|
8 |
+
the total area '
|
9 |
article: null
|
10 |
thumbnail: null
|
11 |
theme: gradio/seafoam
|
12 |
css: null
|
13 |
allow_flagging: never
|
14 |
inputs:
|
15 |
+
- class_string: gradio.components.Dataframe
|
16 |
kwargs:
|
17 |
+
label: shapes
|
18 |
+
type: array
|
19 |
+
- class_string: gradio.components.Dataframe
|
20 |
+
kwargs:
|
21 |
+
label: dimensions
|
22 |
+
type: array
|
23 |
outputs:
|
24 |
+
- class_string: gradio.components.Number
|
25 |
kwargs:
|
26 |
label: output
|
27 |
fn:
|
28 |
class_string: gradify.gradify_closure
|
29 |
kwargs:
|
30 |
argmaps:
|
31 |
+
- label: shapes
|
32 |
+
postprocessing: 'lambda array: list(map(str, array[0]))'
|
33 |
+
- label: dimensions
|
34 |
+
postprocessing: 'lambda array: list(map(float, array[0]))'
|
35 |
func_kwargs: {}
|
36 |
+
source: "import math\n\n\ndef calculate_area(shapes, dimensions):\n total_area\
|
37 |
+
\ = 0\n for i in range(len(shapes)):\n if shapes[i] == 'circle':\n\
|
38 |
+
\ total_area += math.pi * dimensions[i] ** 2\n elif shapes[i]\
|
39 |
+
\ == 'rectangle':\n total_area += dimensions[i] * dimensions[i\
|
40 |
+
\ + 1]\n elif shapes[i] == 'square':\n total_area += dimensions[i]\
|
41 |
+
\ ** 2\n return total_area"
|