Skip to content

[docs] Fix three English code examples that fail to parse - #15441

Open
daluan217 wants to merge 1 commit into
huggingface:mainfrom
daluan217:docs/fix-en-unparsable-examples
Open

daluan217 wants to merge 1 commit into
huggingface:mainfrom
daluan217:docs/fix-en-unparsable-examples

Conversation

@daluan217

Copy link
Copy Markdown

What does this PR do?

Fixes three English code examples that raise an error when copied:

  • api/models/hunyuan_video15_transformer_3d.md: missing comma before subfolder=, and torch.bfloat16 was used without import torch.
  • api/pipelines/ltx_video.md: missing comma after the GGUF URL in AutoModel.from_single_file(...).
  • using-diffusers/text-img2vid.md: from diffusers importAutoModel → from diffusers import AutoModel.

Fixes #15440 (English pages only, per the comment there; translations are generated by the doc-builder).

How I checked it

ast.parse on every Python block in the three changed files: 3 fail on main (08d5de3), 0 on this branch.

python3 -c "import ast,re,sys; [ast.parse(m) for f in sys.argv[1:] for m in re.findall(r'^ *\`\`\`py(?:thon)?\n(.*?)^ *\`\`\`', open(f).read(), re.S|re.M)]" \
  docs/source/en/api/models/hunyuan_video15_transformer_3d.md docs/source/en/using-diffusers/text-img2vid.md

(The LTX block is fence-indented inside a <hfoption>, so it needs dedenting before ast.parse.) I did not run the pipelines themselves.

Self-review notes

I followed the self-review skill: the diff (git diff main...HEAD) checked against .ai/references/review-rules.md.

  • Blocking: none.
  • Non-blocking: none.
  • Dead code: not applicable (docs only).
  • Documentation impact: none beyond the fix.
  • Verdict: READY.

Before submitting

Who can review?

Docs: @stevhliu

Co-Authored-By: Claude Code <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation fixes-issue size/S PR with diff < 50 LOC labels Nov 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation fixes-issue size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs] 14 code examples fail to parse (missing commas, words split mid-line in zh translations)

2 participants