New stylings for onnx and pytorch #13

Merged
benchinnery merged 2 commits from widget-style-fixes into main 2025-11-20 09:38:25 -05:00
Showing only changes of commit 557c46f632 - Show all commits

View File

@ -581,7 +581,9 @@ def performance_metrics(file_path: Path) -> go.Figure:
gauge={ gauge={
"axis": {"range": [0, 100]}, "axis": {"range": [0, 100]},
"bar": { "bar": {
"color": "#ef4444" if complexity_score > 70 else "#f59e0b" if complexity_score > 40 else "#10b981" "color": (
"#ef4444" if complexity_score > 70 else "#f59e0b" if complexity_score > 40 else "#10b981"
)
}, },
"steps": [ "steps": [
{"range": [0, 40], "color": "rgba(16, 185, 129, 0.12)"}, {"range": [0, 40], "color": "rgba(16, 185, 129, 0.12)"},
@ -623,10 +625,11 @@ def performance_metrics(file_path: Path) -> go.Figure:
except Exception as e: except Exception as e:
import traceback import traceback
error_details = f"Error: {str(e)}\n\nTraceback: {traceback.format_exc()}" error_details = f"Error: {str(e)}\n\nTraceback: {traceback.format_exc()}"
print(f"[ONNX Performance Metrics] Error: {error_details}") print(f"[ONNX Performance Metrics] Error: {error_details}")
return create_styled_error_figure( return create_styled_error_figure(
"Performance Analysis Error", "Performance Analysis Error",
f"Could not analyze ONNX model performance: {str(e)}", f"Could not analyze ONNX model performance: {str(e)}",
"Check the server logs for more details" "Check the server logs for more details",
) )