lint commited on
Commit
7e26dac
·
1 Parent(s): a54926f

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. demo.yaml +28 -19
demo.yaml CHANGED
@@ -4,38 +4,47 @@ lite_metadata:
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"
 
 
 
4
  class_string: gradio.interface.Interface
5
  kwargs:
6
  title: gitio app
7
+ description: An app to recieve n numbers comma separated and spit a Random Function
8
+ with n variables and show 2 int inputs to evaluate the function derivative and
9
+ integral
10
  article: null
11
  thumbnail: null
12
  theme: gradio/seafoam
13
  css: null
14
  allow_flagging: never
15
  inputs:
16
+ - class_string: gradio.components.Textbox
17
  kwargs:
18
+ label: function
19
+ - class_string: gradio.components.Number
 
20
  kwargs:
21
+ label: a
22
+ precision: 0
 
23
  - class_string: gradio.components.Number
24
+ kwargs:
25
+ label: b
26
+ precision: 0
27
+ outputs:
28
+ - class_string: gradio.components.Dataframe
29
  kwargs:
30
  label: output
31
+ type: array
32
  fn:
33
  class_string: gradify.gradify_closure
34
  kwargs:
35
  argmaps:
36
+ - label: function
37
+ postprocessing: null
38
+ - label: a
39
+ postprocessing: null
40
+ - label: b
41
+ postprocessing: null
42
  func_kwargs: {}
43
+ source: "import random\nimport numpy as np\n\n\ndef random_function(n):\n \
44
+ \ variables = [f'x{i}' for i in range(n)]\n function = ''\n for i in\
45
+ \ range(n):\n coefficient = random.randint(-10, 10)\n function\
46
+ \ += f'{coefficient}*{variables[i]} + '\n function = function[:-3]\n \
47
+ \ return function\n\n\ndef evaluate_derivative_integral(function, a, b):\n\
48
+ \ x = np.linspace(a, b, 1000)\n y = eval(function)\n derivative =\
49
+ \ np.gradient(y, x)[0]\n integral = np.trapz(y, x)\n return [derivative,\
50
+ \ integral]\n"