Spaces:
Configuration error
Configuration error
Project Conventions for Claude Code
CRITICAL: Commit & Attribution Rules
Claude Code MUST follow these rules without exception:
- NEVER add
Co-Authored-By: Claudeor any AI co-author trailer to commit messages. - NEVER add
π€ Generated with Claude Codefooters or any AI attribution. - NEVER mention Claude, Anthropic, OpenAI, Copilot, AI, LLMs, or any model/assistant name in commit messages, code comments, file headers, documentation, PR descriptions, or changelogs.
- All commits must be authored solely by:
- Name:
apoorvrajdev - Email:
apoorvrajmgr@gmail.com
- Name:
- NEVER stage or commit changes on your own. Only suggest commit messages β the user runs
git committhemselves. - NEVER push to remote. Only the user pushes.
- NEVER create branches, tags, or releases on your own.
Commit Message Format
Use Conventional Commits. Examples:
chore: initial repo scaffoldingfeat(backend): add /caption endpoint for image uploadfeat(inference): add beam search decoderfix(data): correct COCO split deduplicationfix(training): stabilize loss scaling for mixed precisiondocs: update stabilized training runbooktest(evaluation): add BLEU/CIDEr metric testsrefactor(models): extract encoder CNN factoryperf(inference): cache image features for batched predict
Keep subject under 72 characters. Body optional but explains why, not what.
Project Stack
- Core ML: Python 3.10+, TensorFlow / Keras, NumPy, Pillow
- Model: InceptionV3 encoder + Transformer decoder for image captioning
- Backend: FastAPI app under
backend/app/(routes, services, schemas, utils) - Frontend: React 18 + Vite (JSX) under
frontend/, ESLint configured - Config: YAML configs under
configs/loaded viasrc/captioning/config/ - Data: MS COCO pipeline under
src/captioning/data/ - Evaluation: BLEU, CIDEr, METEOR, ROUGE under
src/captioning/evaluation/ - Tooling:
pyproject.toml,Makefile,pytest, packaging ascaptioning
Repository Layout (authoritative)
src/captioning/β installable library (config,data,models,preprocessing,training,inference,evaluation,utils)backend/app/β FastAPI service (api/routes.py,services/predictor_service.py,schemas/,core/,utils/)frontend/src/β React UI (components/,services/api.js)scripts/β CLI entrypoints (train.py,evaluate.py,predict.py, etc.)configs/β YAML training/eval configsmodels/vX.Y.Z/β versioned model artifacts (model.h5,vocab.json)tests/unit/β pytest unit testsnotebooks/β exploratory notebooks (not part of runtime)docs/β phase notes and runbooks
Code Standards
- Python: type hints on all new/edited public functions; prefer
pathlib.Pathover string paths - Imports: absolute imports from
captioning.*; no relative imports across top-level packages - Determinism: seed NumPy / TF / Python
randomwhenever introducing stochastic code paths in training or evaluation - Configs: never hardcode hyperparameters in scripts β extend
src/captioning/config/schema.pyand update the relevant YAML inconfigs/ - Models / vocab: never modify files under
models/vX.Y.Z/in place; bump the version directory instead - Backend layering:
api/routes.pyonly orchestrates; inference logic stays inbackend/app/services/andsrc/captioning/inference/ - Schemas: all FastAPI request/response bodies go through Pydantic schemas in
backend/app/schemas/ - Frontend: functional components + hooks; keep API calls inside
frontend/src/services/api.js - Tests: new behavior gets a unit test under
tests/unit/; keep tests CPU-only and offline (no network, no real model downloads)
Working Style
- Plan before implementing for any non-trivial change (training loop, decoder, data pipeline, API contract)
- One module at a time, with tests
- Run
pytestfor touched areas before declaring a change done - After making changes, summarize what you did so the user can review and commit
- If a change spans library + backend + frontend, list the affected files grouped by layer in the summary