lint commited on
Commit
3ec40f1
·
1 Parent(s): 46cbd5d

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. demo.yaml +12 -17
  2. gradify.py +4 -8
  3. requirements.txt +1 -1
demo.yaml CHANGED
@@ -1,8 +1,9 @@
1
  lite_metadata:
2
  gradio_version: 3.32.0
 
3
  class_string: gradio.interface.Interface
4
  kwargs:
5
- title: Gradio Webapp
6
  description: Given list of strings, create regex to extract dates
7
  article: null
8
  thumbnail: null
@@ -10,27 +11,21 @@ kwargs:
10
  css: null
11
  allow_flagging: never
12
  inputs:
13
- class_string: liteobj.listify
14
- args:
15
- - class_string: gradio.components.Dataframe
16
- kwargs:
17
- label: strings
18
- type: array
19
  outputs:
20
- class_string: liteobj.listify
21
- args:
22
- - class_string: gradio.components.Dataframe
23
- kwargs:
24
- label: output
25
- type: array
26
  fn:
27
  class_string: gradify.gradify_closure
28
  kwargs:
29
  argmaps:
30
- class_string: liteobj.listify
31
- args:
32
- - label: strings
33
- postprocessing: 'lambda array: list(map(str, array[0]))'
34
  func_kwargs: {}
35
  ldict:
36
  class_string: gradify.exec_to_dict
 
1
  lite_metadata:
2
  gradio_version: 3.32.0
3
+ liteobj_version: 0.0.7
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
 
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
  ldict:
31
  class_string: gradify.exec_to_dict
gradify.py CHANGED
@@ -1,7 +1,10 @@
1
 
2
 
3
- def gradify_closure(ldict, argmaps, func_kwargs={}):
4
 
 
 
 
5
  from types import FunctionType
6
  for k, v in ldict.items():
7
  if isinstance(v, FunctionType):
@@ -29,10 +32,3 @@ def gradify_closure(ldict, argmaps, func_kwargs={}):
29
  raise gr.Error(f"Error: {e}")
30
 
31
  return gradify_func
32
-
33
- def exec_to_dict(source, target=None):
34
-
35
- ldict = {}
36
- exec(source, globals(), ldict)
37
-
38
- return ldict.get(target, None) if target else ldict
 
1
 
2
 
3
+ def gradify_closure(source, argmaps, func_kwargs={}):
4
 
5
+ ldict = {}
6
+ exec(source, globals(), ldict)
7
+
8
  from types import FunctionType
9
  for k, v in ldict.items():
10
  if isinstance(v, FunctionType):
 
32
  raise gr.Error(f"Error: {e}")
33
 
34
  return gradify_func
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
  gradio==3.32
2
- liteobj==0.0.4
 
1
  gradio==3.32
2
+ liteobj==0.0.7