lint commited on
Commit
5475251
1 Parent(s): 1b74229

Upload folder using huggingface_hub

Browse files
__pycache__/gradify.cpython-310.pyc CHANGED
Binary files a/__pycache__/gradify.cpython-310.pyc and b/__pycache__/gradify.cpython-310.pyc differ
 
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 a string s, find the length of the longest substring without
7
  repeating characters
8
  article: null
@@ -11,31 +12,22 @@ kwargs:
11
  css: null
12
  allow_flagging: never
13
  inputs:
14
- class_string: liteobj.listify
15
- args:
16
- - class_string: gradio.components.Textbox
17
- kwargs:
18
- label: s
19
  outputs:
20
- class_string: liteobj.listify
21
- args:
22
- - class_string: gradio.components.Number
23
- kwargs:
24
- label: output
25
- precision: 0
26
  fn:
27
  class_string: gradify.gradify_closure
28
  kwargs:
29
  argmaps:
30
- class_string: liteobj.listify
31
- args:
32
- - label: s
33
- postprocessing: null
34
  func_kwargs: {}
35
- ldict:
36
- class_string: gradify.exec_to_dict
37
- kwargs:
38
- source: "def lengthOfLongestSubstring(s):\n seen = {}\n start = 0\n\
39
- \ max_len = 0\n for end in range(len(s)):\n if s[end] in\
40
- \ seen:\n start = max(start, seen[s[end]] + 1)\n seen[s[end]]\
41
- \ = end\n max_len = max(max_len, end - start + 1)\n return max_len\n"
 
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 max substring
7
  description: Given a string s, find the length of the longest substring without
8
  repeating characters
9
  article: null
 
12
  css: null
13
  allow_flagging: never
14
  inputs:
15
+ - class_string: gradio.components.Textbox
16
+ kwargs:
17
+ label: s
 
 
18
  outputs:
19
+ - class_string: gradio.components.Number
20
+ kwargs:
21
+ label: output
22
+ precision: 0
 
 
23
  fn:
24
  class_string: gradify.gradify_closure
25
  kwargs:
26
  argmaps:
27
+ - label: s
28
+ postprocessing: null
 
 
29
  func_kwargs: {}
30
+ source: "def lengthOfLongestSubstring(s):\n seen = {}\n start = 0\n \
31
+ \ max_len = 0\n for end in range(len(s)):\n if s[end] in seen:\n\
32
+ \ start = max(start, seen[s[end]] + 1)\n seen[s[end]] =\
33
+ \ end\n max_len = max(max_len, end - start + 1)\n return max_len\n"
 
 
 
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