Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -930,87 +930,87 @@ def create_interface():
|
|
930 |
)
|
931 |
|
932 |
# Freight Cost Prediction Tab
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
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 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
|
|
997 |
)
|
998 |
-
|
999 |
-
|
|
|
1000 |
minimum=0,
|
1001 |
-
maximum=
|
|
|
|
|
1002 |
)
|
1003 |
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
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"):
|