Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -71,8 +71,17 @@ input_data = pd.DataFrame([{
|
|
| 71 |
if st.button("Predict Engine Condition"):
|
| 72 |
try:
|
| 73 |
prediction = ada_model.predict(input_data)[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
st.subheader("Prediction Result")
|
| 75 |
-
st.success(f"Estimated Engine Condition: **{
|
|
|
|
| 76 |
except Exception as e:
|
| 77 |
st.error(f"❌ Error during prediction: {str(e)}")
|
| 78 |
-
|
|
|
|
| 71 |
if st.button("Predict Engine Condition"):
|
| 72 |
try:
|
| 73 |
prediction = ada_model.predict(input_data)[0]
|
| 74 |
+
|
| 75 |
+
# Map numeric prediction to labels
|
| 76 |
+
if prediction == 0:
|
| 77 |
+
result = "Good ✅"
|
| 78 |
+
elif prediction == 1:
|
| 79 |
+
result = "Faulty ❌"
|
| 80 |
+
else:
|
| 81 |
+
result = f"Unknown ({prediction})"
|
| 82 |
+
|
| 83 |
st.subheader("Prediction Result")
|
| 84 |
+
st.success(f"Estimated Engine Condition: **{result}**")
|
| 85 |
+
|
| 86 |
except Exception as e:
|
| 87 |
st.error(f"❌ Error during prediction: {str(e)}")
|
|
|