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

Aberta
#15,440 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@daluan217 já está trabalhando nisso.

Desde 30/11/2026.

  • #15441 de @daluan217 — aberto

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
10/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
python, pytorch
Domínio
documentation

Direção de pesquisa

The issue lists affected Markdown files under api/models, api/pipelines, using-diffusers, optimization, tutorials, and modular_diffusers. Start by checking the linked pull request #15441 and compare each reported Python example with its English counterpart. Done means the reported code blocks parse successfully, with remaining failures limited to printed representations as described.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Describe the bug

These Python examples raise SyntaxError when copied:

  • en: api/models/hunyuan_video15_transformer_3d.md (missing comma before subfolder=), api/pipelines/ltx_video.md (missing comma after the GGUF URL), using-diffusers/text-img2vid.md (from diffusers importAutoModel)
  • ko: using-diffusers/loading_adapters.md (indentation made of non-breaking spaces, U+00A0)
  • zh: identifiers split across lines, e.g. unet.to(memory / _format=...), residual_diff_thre / shold, ty / pe_hint, "h / ttps://...", ["contr / olnet_denoise", ...]. Also pipe line= ..., import compile regions, a missing comma after adapter_name="cinematic", a missing ), and two indentation slips. Files: optimization/{cache,fp16,memory,para_attn}.md, tutorials/using_peft_for_inference.md, modular_diffusers/{modular_pipeline,components_manager,sequential_pipeline_blocks,quickstart,pipeline_block}.md
Reproduction

From docs/source/en/api/models/hunyuan_video15_transformer_3d.md:

transformer = HunyuanVideo15Transformer3DModel.from_pretrained("hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-480p_t2v" subfolder="transformer", dtype=torch.bfloat16)
# SyntaxError: invalid syntax. Perhaps you forgot a comma?

Running ast.parse on every Python block in these 14 files finds 17 failures on main (08d5de3).

Context

Each fix is the smallest edit that matches the English page. With them, 3 failures remain, and those are printed reprs (ComponentSpec(... type_hint=<class ...>)), not code. I have the branch ready and would open one PR after a maintainer confirms the scope, with the self-review notes included.

I found these with an AI coding assistant and checked each edit by hand.

Logs

No response

System Info

Documentation only; checked with Python 3.12 ast.parse.

Who can help?

@stevhliu @sayakpaul

Linguagem predominante
Python
Estrelas
35k
Forks
7.5k
Merge médio
2d 22h
PRs com merge (30d)
58

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de huggingface/diffusers

Todas as issues de huggingface/diffusers

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.