Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- demo.yaml +12 -21
- gradify.py +1 -1
demo.yaml
CHANGED
@@ -3,39 +3,30 @@ lite_metadata:
|
|
3 |
liteobj_version: 0.0.7
|
4 |
class_string: gradio.interface.Interface
|
5 |
kwargs:
|
6 |
-
title:
|
7 |
-
description: Given
|
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.
|
16 |
kwargs:
|
17 |
-
label:
|
18 |
-
|
19 |
-
- class_string: gradio.components.Number
|
20 |
-
kwargs:
|
21 |
-
label: num2
|
22 |
-
precision: 0
|
23 |
outputs:
|
24 |
-
- class_string: gradio.components.
|
25 |
kwargs:
|
26 |
label: output
|
27 |
-
|
28 |
fn:
|
29 |
class_string: gradify.gradify_closure
|
30 |
kwargs:
|
31 |
argmaps:
|
32 |
-
- label:
|
33 |
-
postprocessing:
|
34 |
-
- label: num2
|
35 |
-
postprocessing: null
|
36 |
func_kwargs: {}
|
37 |
-
source: "
|
38 |
-
\ =
|
39 |
-
\
|
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"
|
|
|
3 |
liteobj_version: 0.0.7
|
4 |
class_string: gradio.interface.Interface
|
5 |
kwargs:
|
6 |
+
title: Gradio Webapp
|
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 matches\
|
32 |
+
\ = re.findall(regex, string)\n dates.extend(matches)\n return dates\n"
|
|
|
|
gradify.py
CHANGED
@@ -31,4 +31,4 @@ def gradify_closure(source, argmaps, func_kwargs={}):
|
|
31 |
import gradio as gr
|
32 |
raise gr.Error(f"Error: {e}")
|
33 |
|
34 |
-
return gradify_func
|
|
|
31 |
import gradio as gr
|
32 |
raise gr.Error(f"Error: {e}")
|
33 |
|
34 |
+
return gradify_func
|