Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -188,7 +188,7 @@ def predict_inverse(hardness_original_target, ys_original_target, metals_to_use,
|
|
188 |
result[column]/= sum_metals
|
189 |
result[column] = round(result[column], 2)
|
190 |
|
191 |
-
return result
|
192 |
|
193 |
|
194 |
example_inputs = [820, 1800]
|
@@ -240,33 +240,25 @@ with gr.Blocks(css=css_styling, title=page_title, theme=osium_theme) as demo:
|
|
240 |
)
|
241 |
with gr.Column():
|
242 |
with gr.Row():
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
#with gr.Row():
|
253 |
-
#with gr.Column():
|
254 |
-
#with gr.Row():
|
255 |
-
# gr.Markdown("### Interpretation of hardness prediction")
|
256 |
-
# gr.Markdown("### Interpretation of yield strength prediction")
|
257 |
-
#with gr.Row():
|
258 |
-
# output_interpretation = gr.Plot(label="Interpretation")
|
259 |
|
260 |
with gr.Row():
|
261 |
-
gr.Examples([example_inputs], [input_hardness, input_yield_strength])
|
262 |
|
263 |
|
264 |
|
265 |
prediction_button.click(
|
266 |
fn=predict_inverse,
|
267 |
inputs=[input_hardness, input_yield_strength, metals_constraints],
|
268 |
-
outputs=[
|
269 |
-
],
|
270 |
show_progress=True,
|
271 |
)
|
272 |
clear_button.click(
|
|
|
188 |
result[column]/= sum_metals
|
189 |
result[column] = round(result[column], 2)
|
190 |
|
191 |
+
return result[:-3], result[-3], result[0], result[1], result[-2], result[-1]
|
192 |
|
193 |
|
194 |
example_inputs = [820, 1800]
|
|
|
240 |
)
|
241 |
with gr.Column():
|
242 |
with gr.Row():
|
243 |
+
with gr.Column():
|
244 |
+
gr.Markdown("### Your optimal alloy formula and processing conditions")
|
245 |
+
optimal_formula = gr.DataFrame(label="Your optimal alloy formula", wrap=True)
|
246 |
+
optimal_processing_method = gr.Text(label="Processing method")
|
247 |
+
gr.Markdown("### Additional information about your optimal alloy")
|
248 |
+
density = gr.Text(label="Density (g/cm3)")
|
249 |
+
young_modulus = gr.Text(label = "Young modulus (GPa)")
|
250 |
+
microstructure = gr.Text(label="Microstructure (BCC/FCC/Other)")
|
251 |
+
phase = gr.Text(label="Number of phases (S/M)")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
|
253 |
with gr.Row():
|
254 |
+
gr.Examples([example_inputs], [input_hardness, input_yield_strength, ['Al', 'Fe']])
|
255 |
|
256 |
|
257 |
|
258 |
prediction_button.click(
|
259 |
fn=predict_inverse,
|
260 |
inputs=[input_hardness, input_yield_strength, metals_constraints],
|
261 |
+
outputs=[optimal_formula, optimal_processing_method, density, young_modulus, microstructure, phase],
|
|
|
262 |
show_progress=True,
|
263 |
)
|
264 |
clear_button.click(
|