MohamedRabie26 commited on
Commit
1e6306f
1 Parent(s): 9f0ca63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -3,8 +3,8 @@ import joblib
3
  from PIL import Image
4
 
5
  # Load already saved pipelines
6
- best_model_cs = joblib.load("modelCS.pkl")
7
- best_model_co2 = joblib.load("modelCO2.pkl")
8
 
9
  # Prediction function for compressive strength model
10
  def make_prediction(Fly_ash, GGBS_GGBFS, Fine_aggregate, Na2SiO3_solution, NaOH_solution, NaOH_concentration, Superplasticiser, Curing_temperature, Curing_Period, Testing_Age):
@@ -12,23 +12,24 @@ def make_prediction(Fly_ash, GGBS_GGBFS, Fine_aggregate, Na2SiO3_solution, NaOH_
12
  predt_co2 = best_model_co2.predict([[Fly_ash, GGBS_GGBFS, Fine_aggregate, Na2SiO3_solution, NaOH_solution, NaOH_concentration, Superplasticiser, Curing_temperature, Curing_Period, Testing_Age]])
13
  value_cs = round(predt_cs[0], 3)
14
  value_co2 = round(predt_co2[0], 3)
15
- image_component = gr.Image("MOO results.png", label="multi-objective optimization", type="pil")
16
  return value_cs, value_co2, image_component,
17
 
18
  # Inputs for the models
19
  inputs = [
20
- gr.Slider(0, 961.0, label='Fly ash (Kg/m³)', info="Amount of Fly ash (Kg/m³)"),
21
  gr.Slider(0, 711.0, label='GGBS or GGBFS (Kg/m³)', info="Amount of Ground Granulated Blast Furnace Slag(Kg/m³)"),
22
- gr.Slider(0, 1956.0, label='Fine aggregate (Kg/m³)', info="Amount of Fine aggregate (Kg/m³)"),
23
- gr.Slider(0, 531.0, label='Na₂SiO₃ solution (Kg/m³)', info="Amount of Sodium Silicate solution (Kg/m³)"),
24
- gr.Slider(0, 284.44, label='NaOH solution (Kg/m³)', info="Amount of Sodium Hydroxide solution (Kg/m³)"),
25
  gr.Slider(0, 16.0, label='NaOH concentration (M)', info="Sodium Hydroxide concentration (M)"),
26
  gr.Slider(0, 35.555, label='Superplasticiser (kg/m³)', info="Amount of Superplasticiser (kg/m³)"),
27
- gr.Slider(-7.5, 800.0, label='Curing temperature (°C)'),
28
- gr.Slider(1, 180, label='Curing Period (days)'),
29
- gr.Slider(1, 180, label='Testing Age (days)'),
30
  ]
31
 
 
32
  # Outputs for both models
33
  outputs = [
34
  gr.Textbox(label="Compressive strength (MPa)"),
 
3
  from PIL import Image
4
 
5
  # Load already saved pipelines
6
+ best_model_cs = joblib.load("modelCS_V3.pkl")
7
+ best_model_co2 = joblib.load("modelCO2_V3.pkl")
8
 
9
  # Prediction function for compressive strength model
10
  def make_prediction(Fly_ash, GGBS_GGBFS, Fine_aggregate, Na2SiO3_solution, NaOH_solution, NaOH_concentration, Superplasticiser, Curing_temperature, Curing_Period, Testing_Age):
 
12
  predt_co2 = best_model_co2.predict([[Fly_ash, GGBS_GGBFS, Fine_aggregate, Na2SiO3_solution, NaOH_solution, NaOH_concentration, Superplasticiser, Curing_temperature, Curing_Period, Testing_Age]])
13
  value_cs = round(predt_cs[0], 3)
14
  value_co2 = round(predt_co2[0], 3)
15
+ image_component = gr.Image("MOO results_V3.png", label="multi-objective optimization", type="pil")
16
  return value_cs, value_co2, image_component,
17
 
18
  # Inputs for the models
19
  inputs = [
20
+ gr.Slider(20, 961.0, label='Fly ash (Kg/m³)', info="Amount of Fly ash (Kg/m³)"),
21
  gr.Slider(0, 711.0, label='GGBS or GGBFS (Kg/m³)', info="Amount of Ground Granulated Blast Furnace Slag(Kg/m³)"),
22
+ gr.Slider(100, 1956.0, label='Fine aggregate (Kg/m³)', info="Amount of Fine aggregate (Kg/m³)"),
23
+ gr.Slider(10, 531.0, label='Na₂SiO₃ solution (Kg/m³)', info="Amount of Sodium Silicate solution (Kg/m³)"),
24
+ gr.Slider(10, 284.44, label='NaOH solution (Kg/m³)', info="Amount of Sodium Hydroxide solution (Kg/m³)"),
25
  gr.Slider(0, 16.0, label='NaOH concentration (M)', info="Sodium Hydroxide concentration (M)"),
26
  gr.Slider(0, 35.555, label='Superplasticiser (kg/m³)', info="Amount of Superplasticiser (kg/m³)"),
27
+ gr.Slider(20, 120, label='Curing temperature (°C)'),
28
+ gr.Slider(1, 90, label='Curing Period (days)', info="For curing temperature more than 30 °C the curing period should be maximum of 3 days"),
29
+ gr.Slider(1, 180, label='Testing Age (days)', info="For curing temperature less than 30 °C the testing age should be equal to the curing period"),
30
  ]
31
 
32
+
33
  # Outputs for both models
34
  outputs = [
35
  gr.Textbox(label="Compressive strength (MPa)"),