Skip to content

Fix notebook schema validation errors#20

Closed
ThierryHJ wants to merge 1 commit into
duoan:masterfrom
ThierryHJ:fix/notebook-schema-validation
Closed

Fix notebook schema validation errors#20
ThierryHJ wants to merge 1 commit into
duoan:masterfrom
ThierryHJ:fix/notebook-schema-validation

Conversation

@ThierryHJ
Copy link
Copy Markdown
Contributor

Summary

  • remove invalid code-only fields from markdown cells in affected template and solution notebooks
  • add a notebook validation script with --fix support
  • add a GitHub Actions workflow to validate notebooks on PRs and master pushes

Root cause

GitHub's notebook renderer rejects notebooks where markdown cells contain code-cell-only fields like outputs. The causal-attention notebook had outputs: [] on its first markdown cell, and the same schema issue appeared in 66 notebooks.

Validation

  • python3 scripts/validate_notebooks.py
  • python3 -c 'import nbformat; nb=nbformat.read("templates/09_causal_attention.ipynb", as_version=4); nbformat.validate(nb); print("templates/09_causal_attention.ipynb valid")'
  • env PYTHONPYCACHEPREFIX=/private/tmp/torchcode-pycache python3 -m py_compile scripts/validate_notebooks.py
  • git diff --check

@ThierryHJ ThierryHJ force-pushed the fix/notebook-schema-validation branch 5 times, most recently from a3a0a11 to 98716ec Compare May 30, 2026 22:48
@ThierryHJ ThierryHJ force-pushed the fix/notebook-schema-validation branch from 98716ec to 3c89f79 Compare May 30, 2026 22:50
@ThierryHJ
Copy link
Copy Markdown
Contributor Author

Closing for now because the remaining notebook preview failure appears to be a GitHub renderer issue affecting other repositories too. The branch keeps the local notebook hygiene fixes, and we can reopen or recreate this PR after GitHub resolves the global renderer issue.

@ThierryHJ ThierryHJ closed this May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant