Update app.py
Browse files
app.py
CHANGED
|
@@ -46,9 +46,9 @@ def generate_example(dim1: list, dim2: list):
|
|
| 46 |
return dim1, dim2, code
|
| 47 |
|
| 48 |
|
| 49 |
-
def
|
| 50 |
if dim is None:
|
| 51 |
-
gr.Error("one of the
|
| 52 |
if "[" in dim:
|
| 53 |
dim = dim.replace("[", "")
|
| 54 |
if "]" in dim:
|
|
@@ -163,8 +163,8 @@ def substitute_ones_with_concat(dim1, dim2, version=1):
|
|
| 163 |
|
| 164 |
|
| 165 |
def predict(dim1, dim2):
|
| 166 |
-
dim1 =
|
| 167 |
-
dim2 =
|
| 168 |
n1, n2 = len(dim1), len(dim2)
|
| 169 |
dim1, dim2, out = generate_example(dim1, dim2)
|
| 170 |
# TODO
|
|
|
|
| 46 |
return dim1, dim2, code
|
| 47 |
|
| 48 |
|
| 49 |
+
def sanitize_dimension(dim):
|
| 50 |
if dim is None:
|
| 51 |
+
gr.Error("one of the dimensions is empty, please fill it")
|
| 52 |
if "[" in dim:
|
| 53 |
dim = dim.replace("[", "")
|
| 54 |
if "]" in dim:
|
|
|
|
| 163 |
|
| 164 |
|
| 165 |
def predict(dim1, dim2):
|
| 166 |
+
dim1 = sanitize_dimension(dim1)
|
| 167 |
+
dim2 = sanitize_dimension(dim2)
|
| 168 |
n1, n2 = len(dim1), len(dim2)
|
| 169 |
dim1, dim2, out = generate_example(dim1, dim2)
|
| 170 |
# TODO
|