edit final comment
Browse files
app.py
CHANGED
@@ -139,7 +139,7 @@ def check_validity(dim1,dim2):
|
|
139 |
|
140 |
|
141 |
def substitute_ones_with_concat(dim1,dim2):
|
142 |
-
for i in range(len(dim1)-
|
143 |
dim1[i] = dim2[i] if dim1[i] == 1 else dim1[i]
|
144 |
dim2[i] = dim1[i] if dim2[i] == 1 else dim2[i]
|
145 |
return dim1, dim2
|
@@ -168,7 +168,9 @@ def predict(dim1, dim2):
|
|
168 |
out += "* all the other dimensions should be equal to one another (green or red colors)\n\n" + table3
|
169 |
if "X" not in checks :
|
170 |
dim1[-1] = dim2[-1]
|
171 |
-
out +=
|
|
|
|
|
172 |
return out
|
173 |
|
174 |
|
@@ -176,7 +178,7 @@ demo = gr.Interface(
|
|
176 |
predict,
|
177 |
inputs=["text", "text"],
|
178 |
outputs=["markdown"],
|
179 |
-
examples=[["9,2,1,3,3", "5,3,7"], ["
|
180 |
)
|
181 |
|
182 |
demo.launch(debug=True)
|
|
|
139 |
|
140 |
|
141 |
def substitute_ones_with_concat(dim1,dim2):
|
142 |
+
for i in range(len(dim1)-1):
|
143 |
dim1[i] = dim2[i] if dim1[i] == 1 else dim1[i]
|
144 |
dim2[i] = dim1[i] if dim2[i] == 1 else dim2[i]
|
145 |
return dim1, dim2
|
|
|
168 |
out += "* all the other dimensions should be equal to one another (green or red colors)\n\n" + table3
|
169 |
if "X" not in checks :
|
170 |
dim1[-1] = dim2[-1]
|
171 |
+
out += "\n# Final dimension\n"
|
172 |
+
out+="as highlighted in <strong style='color:green'> green </strong> \n\n"
|
173 |
+
out+= f"`output.shape = {dim1}`"
|
174 |
return out
|
175 |
|
176 |
|
|
|
178 |
predict,
|
179 |
inputs=["text", "text"],
|
180 |
outputs=["markdown"],
|
181 |
+
examples=[["9,2,1,3,3", "5,3,7"], ["7,4,2,3", "5,2,7"]],
|
182 |
)
|
183 |
|
184 |
demo.launch(debug=True)
|