lint commited on
Commit
3adacd7
·
1 Parent(s): 85bb126

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. demo.yaml +20 -11
demo.yaml CHANGED
@@ -4,29 +4,38 @@ lite_metadata:
4
  class_string: gradio.interface.Interface
5
  kwargs:
6
  title: gitio date regex
7
- description: Given list of strings, create regex to extract dates
 
8
  article: null
9
  thumbnail: null
10
  theme: gradio/seafoam
11
  css: null
12
  allow_flagging: never
13
  inputs:
14
- - class_string: gradio.components.Dataframe
15
  kwargs:
16
- label: strings
17
- type: array
 
 
 
 
18
  outputs:
19
- - class_string: gradio.components.Dataframe
20
  kwargs:
21
  label: output
22
- type: array
23
  fn:
24
  class_string: gradify.gradify_closure
25
  kwargs:
26
  argmaps:
27
- - label: strings
28
- postprocessing: 'lambda array: list(map(str, array[0]))'
 
 
29
  func_kwargs: {}
30
- source: "import re\n\n\ndef extract_dates(strings):\n regex = '\\\\d{1,2}/\\\
31
- \\d{1,2}/\\\\d{4}'\n dates = []\n for string in strings:\n dates\
32
- \ += re.findall(regex, string)\n return dates\n"
 
 
 
4
  class_string: gradio.interface.Interface
5
  kwargs:
6
  title: gitio date regex
7
+ description: Given two numbers, find the lowest common factor and subtract it from
8
+ 100
9
  article: null
10
  thumbnail: null
11
  theme: gradio/seafoam
12
  css: null
13
  allow_flagging: never
14
  inputs:
15
+ - class_string: gradio.components.Number
16
  kwargs:
17
+ label: num1
18
+ precision: 0
19
+ - class_string: gradio.components.Number
20
+ kwargs:
21
+ label: num2
22
+ precision: 0
23
  outputs:
24
+ - class_string: gradio.components.Number
25
  kwargs:
26
  label: output
27
+ precision: 0
28
  fn:
29
  class_string: gradify.gradify_closure
30
  kwargs:
31
  argmaps:
32
+ - label: num1
33
+ postprocessing: null
34
+ - label: num2
35
+ postprocessing: null
36
  func_kwargs: {}
37
+ source: "def lowest_common_factor(num1, num2):\n factors1 = set()\n factors2\
38
+ \ = set()\n for i in range(1, num1 + 1):\n if num1 % i == 0:\n \
39
+ \ factors1.add(i)\n for i in range(1, num2 + 1):\n if\
40
+ \ num2 % i == 0:\n factors2.add(i)\n common_factors = factors1.intersection(factors2)\n\
41
+ \ return 100 - min(common_factors) if common_factors else 100\n"