Spaces:
Runtime error
Runtime error
Download src/ui/components/progress_tracker.py from Agents-MCP-Hackathon/CodeReviewAgent: direct link, hf CLI and curl.
- Browser
- Download file 1.63 kB
-
https://huggingface.co/spaces/Agents-MCP-Hackathon/CodeReviewAgent/resolve/main/src/ui/components/progress_tracker.py
- Command line
-
hf download hf://spaces/Agents-MCP-Hackathon/CodeReviewAgent/src/ui/components/progress_tracker.py
-
curl -L -o progress_tracker.py https://huggingface.co/spaces/Agents-MCP-Hackathon/CodeReviewAgent/resolve/main/src/ui/components/progress_tracker.py
1.63 kB
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Progress Tracker Component | |
| This module provides the UI component for tracking the progress of the code review process. | |
| """ | |
| import gradio as gr | |
| import logging | |
| logger = logging.getLogger(__name__) | |
| def create_progress_tracker(): | |
| """ | |
| Create the progress tracker component. | |
| Returns: | |
| tuple: A tuple containing (overall_progress, status_message, step_progress_dict) | |
| """ | |
| # Overall progress bar | |
| overall_progress = gr.Slider( | |
| minimum=0, | |
| maximum=100, | |
| value=0, | |
| label="Overall Progress", | |
| interactive=False, | |
| ) | |
| # Status message | |
| status_message = gr.Markdown( | |
| "*Initializing...*" | |
| ) | |
| # Detailed progress steps | |
| steps = [ | |
| "Repository Cloning", | |
| "Language Detection", | |
| "Code Analysis", | |
| "Security Scanning", | |
| "Performance Analysis", | |
| "AI Review", | |
| "Report Generation" | |
| ] | |
| with gr.Accordion("Detailed Progress", open=False): | |
| step_progress = {} | |
| for step in steps: | |
| with gr.Row(variant="panel"): | |
| with gr.Column(scale=1, min_width=150): | |
| gr.Markdown(f"**{step}**") | |
| with gr.Column(scale=4): | |
| step_progress[step] = gr.Slider( | |
| minimum=0, | |
| maximum=100, | |
| value=0, | |
| label="", | |
| interactive=False, | |
| scale=2 | |
| ) | |
| return overall_progress, status_message, step_progress |