Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,35 +47,35 @@ def predict_status(air_temp, proc_temp, speed, torque, tool_wear):
|
|
| 47 |
|
| 48 |
# User-friendly reasons for each feature
|
| 49 |
if air_temp < 150:
|
| 50 |
-
reasons.append("
|
| 51 |
elif air_temp > 500:
|
| 52 |
-
reasons.append("
|
| 53 |
|
| 54 |
if proc_temp < 150:
|
| 55 |
-
reasons.append("
|
| 56 |
elif proc_temp > 500:
|
| 57 |
-
reasons.append("
|
| 58 |
|
| 59 |
if speed < 500:
|
| 60 |
-
reasons.append("
|
| 61 |
elif speed > 1500:
|
| 62 |
-
reasons.append("
|
| 63 |
|
| 64 |
if torque < 100:
|
| 65 |
-
reasons.append("
|
| 66 |
elif torque > 800:
|
| 67 |
-
reasons.append("
|
| 68 |
|
| 69 |
if tool_wear < 50:
|
| 70 |
-
reasons.append("
|
| 71 |
elif tool_wear > 300:
|
| 72 |
-
reasons.append("
|
| 73 |
|
| 74 |
# Generate the final result message
|
| 75 |
if prediction == 0:
|
| 76 |
result_message = "🔴 Machine is NOT working.\n" # First line for machine status
|
| 77 |
if reasons:
|
| 78 |
-
result_message += "\n".join(reasons) # Second row onward for reasons
|
| 79 |
else:
|
| 80 |
result_message += "No specific reason identified." # In case no issues found
|
| 81 |
else:
|
|
|
|
| 47 |
|
| 48 |
# User-friendly reasons for each feature
|
| 49 |
if air_temp < 150:
|
| 50 |
+
reasons.append("• The air temperature is too low, which might be causing the machine to underperform.")
|
| 51 |
elif air_temp > 500:
|
| 52 |
+
reasons.append("• The air temperature is too high, which could be causing the machine to overheat.")
|
| 53 |
|
| 54 |
if proc_temp < 150:
|
| 55 |
+
reasons.append("• The process temperature is below the normal range, possibly affecting machine efficiency.")
|
| 56 |
elif proc_temp > 500:
|
| 57 |
+
reasons.append("• The process temperature is too high, which might lead to overheating.")
|
| 58 |
|
| 59 |
if speed < 500:
|
| 60 |
+
reasons.append("• The rotational speed is too low, causing the machine to operate inefficiently.")
|
| 61 |
elif speed > 1500:
|
| 62 |
+
reasons.append("• The rotational speed is too high, which might be causing excessive strain on the machine.")
|
| 63 |
|
| 64 |
if torque < 100:
|
| 65 |
+
reasons.append("• The torque is too low, which may indicate that the machine is not operating at its full capacity.")
|
| 66 |
elif torque > 800:
|
| 67 |
+
reasons.append("• The torque is too high, possibly putting excessive stress on the machine's components.")
|
| 68 |
|
| 69 |
if tool_wear < 50:
|
| 70 |
+
reasons.append("• The tool wear is minimal, but routine checks are still recommended to prevent future issues.")
|
| 71 |
elif tool_wear > 300:
|
| 72 |
+
reasons.append("• The tool wear is high, and the tool may need to be replaced soon to maintain optimal performance.")
|
| 73 |
|
| 74 |
# Generate the final result message
|
| 75 |
if prediction == 0:
|
| 76 |
result_message = "🔴 Machine is NOT working.\n" # First line for machine status
|
| 77 |
if reasons:
|
| 78 |
+
result_message += "\n".join(reasons) # Second row onward for reasons with bullet points
|
| 79 |
else:
|
| 80 |
result_message += "No specific reason identified." # In case no issues found
|
| 81 |
else:
|