Spaces:
Running
Running
Abid Ali Awan
feat: Enhance data analysis tool with new visualization features, improve model training metrics, and update deployment examples for better clarity.
b4b8231 A newer version of the Gradio SDK is available: 6.13.0
Repository Guidelines
Project Structure & Module Organization
app.py: Gradio 6 MCP server exposing analyze/train/deploy/auto-deploy tools.modal_backend.py: Modal functions for data analysis, training, and deployment; keep remote-heavy logic isolated here.requirements.txt: runtime/tooling pins. Create a local.venv/for installs. Place tests intests/mirroring modules (e.g.,tests/test_app.py).
Build, Test, and Development Commands
- Create env:
uv venvand activate.venv\Scripts\activate. - Install deps with uv (faster resolver inside the venv):
uv pip install -r requirements.txt --python .venv\Scripts\python.exe. - Run MCP server locally:
python app.py(starts Gradio Blocks withmcp_server=True). - Deploy Modal backend:
modal deploy modal_backend.py(publishes functions/volume).
Coding Style & Naming Conventions
- Python 3.10+; 4-space indents, type hints, and short docstrings for agent-facing tools.
- Keep Modal calls wrapped in small helpers; pass explicit JSON-safe payloads.
- Name new tools with
_toolsuffix; snake_case for functions/variables; prefer descriptive model/task identifiers in logs and outputs.
Testing Guidelines
- Add unit tests for request/response handling and error branches; mock Modal functions to keep runs local.
- Gate any integration tests hitting Modal behind env flags to avoid accidental remote calls.
- Command once tests exist:
python -m pytest; ensure coverage of missing-column errors and invalidmodel_idpaths.
Commit & Pull Request Guidelines
- Commit subject in imperative mood (e.g., "Add auto deploy tool"), ~50 chars; add a short body when explaining decisions/rollouts.
- PRs should state what changed, why, and how to verify (commands or sample outputs). Link issues; attach screenshots/log snippets when tool responses or UI surfaces change.
Security & Configuration
- Run
modal setuplocally; keep Modal tokens and API keys out of git. Use.envor Modal secrets instead of hardcoding. - Do not commit user CSVs/PII; use sanitized fixtures for examples/tests and keep temporary data outside the repo.
- Keep docs and sample endpoints aligned with the currently deployed Modal app URL.