Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -146,8 +146,8 @@ def predict_inverse(hardness_original_target, ys_original_target, request: gr.Re
|
|
146 |
constrained_columns = ['Single/Multiphase', 'Preprocessing method', 'BCC/FCC/other'] #'PROPERTY: Metal']#, 'Microstructure']
|
147 |
for constraint in constrained_columns:
|
148 |
sum_string = ''
|
149 |
-
|
150 |
-
|
151 |
if column_one_hot.startswith(constraint):
|
152 |
sum_string = sum_string+"+x[:," + str(i) + "]"
|
153 |
constraints.append({'name': constraint + "+1", 'constraint': sum_string + '-1'})
|
|
|
146 |
constrained_columns = ['Single/Multiphase', 'Preprocessing method', 'BCC/FCC/other'] #'PROPERTY: Metal']#, 'Microstructure']
|
147 |
for constraint in constrained_columns:
|
148 |
sum_string = ''
|
149 |
+
for i in range (len(one_hot.columns)):
|
150 |
+
column_one_hot = one_hot.columns[i]
|
151 |
if column_one_hot.startswith(constraint):
|
152 |
sum_string = sum_string+"+x[:," + str(i) + "]"
|
153 |
constraints.append({'name': constraint + "+1", 'constraint': sum_string + '-1'})
|