AdityaRatan commited on
Commit
28b8ad7
Β·
verified Β·
1 Parent(s): 919b41c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +76 -76
app.py CHANGED
@@ -930,87 +930,87 @@ def create_interface():
930
  )
931
 
932
  # Freight Cost Prediction Tab
933
- with gr.Tab("πŸ’° Cost Prediction", elem_classes="tab-content"):
934
- with gr.Row():
935
- shipment_mode = gr.Dropdown(
936
- choices=["✈️ Air", "🚒 Ocean", "πŸš› Truck"],
937
- label="Transport Mode",
938
- value="✈️ Air"
939
- )
940
-
941
- with gr.Row():
942
- with gr.Column():
943
- weight = gr.Slider(
944
- label="πŸ“¦ Weight (kg)",
945
- minimum=1,
946
- maximum=10000,
947
- step=1,
948
- value=1000
949
- )
950
- with gr.Column():
951
- line_item_value = gr.Slider(
952
- label="πŸ’΅ Item Value (USD)",
953
- minimum=1,
954
- maximum=1000000,
955
- step=1,
956
- value=10000
957
- )
958
- with gr.Column():
959
- cost_per_kg = gr.Slider(
960
- label="πŸ’° Cost per kg (USD)",
961
- minimum=0,
962
- maximum=500,
963
- step=0.1,
964
- value=50
965
- )
966
-
967
- # Mode-specific inputs
968
- with gr.Row(visible=False) as air_inputs:
969
- air_charter_weight = gr.Slider(
970
- label="Air Charter Weight",
971
- minimum=0,
972
- maximum=10000
973
- )
974
- air_charter_value = gr.Slider(
975
- label="Air Charter Value",
976
- minimum=0,
977
- maximum=1000000
978
- )
979
-
980
- with gr.Row(visible=False) as ocean_inputs:
981
- ocean_weight = gr.Slider(
982
- label="Ocean Weight",
983
- minimum=0,
984
- maximum=10000
985
- )
986
- ocean_value = gr.Slider(
987
- label="Ocean Value",
988
- minimum=0,
989
- maximum=1000000
990
  )
991
-
992
- with gr.Row(visible=False) as truck_inputs:
993
- truck_weight = gr.Slider(
994
- label="Truck Weight",
995
- minimum=0,
996
- maximum=10000
 
997
  )
998
- truck_value = gr.Slider(
999
- label="Truck Value",
 
1000
  minimum=0,
1001
- maximum=1000000
 
 
1002
  )
1003
 
1004
- with gr.Row():
1005
- predict_button = gr.Button(
1006
- "πŸ” Calculate Cost",
1007
- variant="primary",
1008
- elem_classes="action-button"
1009
- )
1010
- freight_result = gr.Number(
1011
- label="Predicted Cost (USD)",
1012
- elem_classes="result-box"
1013
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1014
 
1015
  # Chat Tab
1016
  with gr.Tab("πŸ’¬ Chat", elem_classes="tab-content"):
 
930
  )
931
 
932
  # Freight Cost Prediction Tab
933
+ with gr.Tab("πŸ’° Cost Prediction", elem_classes="tab-content"):
934
+ with gr.Row():
935
+ shipment_mode = gr.Dropdown(
936
+ choices=["✈️ Air", "🚒 Ocean", "πŸš› Truck"],
937
+ label="Transport Mode",
938
+ value="✈️ Air"
939
+ )
940
+
941
+ with gr.Row():
942
+ with gr.Column():
943
+ weight = gr.Slider(
944
+ label="πŸ“¦ Weight (kg)",
945
+ minimum=1,
946
+ maximum=10000,
947
+ step=1,
948
+ value=1000
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
949
  )
950
+ with gr.Column():
951
+ line_item_value = gr.Slider(
952
+ label="πŸ’΅ Item Value (USD)",
953
+ minimum=1,
954
+ maximum=1000000,
955
+ step=1,
956
+ value=10000
957
  )
958
+ with gr.Column():
959
+ cost_per_kg = gr.Slider(
960
+ label="πŸ’° Cost per kg (USD)",
961
  minimum=0,
962
+ maximum=500,
963
+ step=0.1,
964
+ value=50
965
  )
966
 
967
+ # Mode-specific inputs
968
+ with gr.Row(visible=False) as air_inputs:
969
+ air_charter_weight = gr.Slider(
970
+ label="Air Charter Weight",
971
+ minimum=0,
972
+ maximum=10000
973
+ )
974
+ air_charter_value = gr.Slider(
975
+ label="Air Charter Value",
976
+ minimum=0,
977
+ maximum=1000000
978
+ )
979
+
980
+ with gr.Row(visible=False) as ocean_inputs:
981
+ ocean_weight = gr.Slider(
982
+ label="Ocean Weight",
983
+ minimum=0,
984
+ maximum=10000
985
+ )
986
+ ocean_value = gr.Slider(
987
+ label="Ocean Value",
988
+ minimum=0,
989
+ maximum=1000000
990
+ )
991
+
992
+ with gr.Row(visible=False) as truck_inputs:
993
+ truck_weight = gr.Slider(
994
+ label="Truck Weight",
995
+ minimum=0,
996
+ maximum=10000
997
+ )
998
+ truck_value = gr.Slider(
999
+ label="Truck Value",
1000
+ minimum=0,
1001
+ maximum=1000000
1002
+ )
1003
+
1004
+ with gr.Row():
1005
+ predict_button = gr.Button(
1006
+ "πŸ” Calculate Cost",
1007
+ variant="primary",
1008
+ elem_classes="action-button"
1009
+ )
1010
+ freight_result = gr.Number(
1011
+ label="Predicted Cost (USD)",
1012
+ elem_classes="result-box"
1013
+ )
1014
 
1015
  # Chat Tab
1016
  with gr.Tab("πŸ’¬ Chat", elem_classes="tab-content"):