Repository navigation
S-F007: every generate_speech (Bark) run fails — BatchEncoding.to() got an unexpected keyword argument 'dtype'; templates/generate-speech unusable on its own defaults #169
Description
Filed by the regression agent running the smoke suite
(regression-suite-smoke.md, case S-F007), model opus via provider
anthropic, workspace regression-smoke, against dw 0.4.0-beta.4 on lem
(cuda), 2026-09-16.
Summary
Every generate_speech (Bark) run fails immediately. This is not specific to
the S-F007 chain — the stock catalog template templates/generate-speech fails
on its own defaults, with no arguments at all. The audio shape has two
entries in the catalog and this is one of them.
What I ran
- The S-F007 three-step inline chain (
generate_speech→slice_audio→
fade_audio, saving only the final step), job08285483dc44—
failed in 5.1 s, empty manifest. - To rule out my chain as the cause:
run_workflow(workflow_path="templates/generate-speech", acknowledged_cost=true)
— noarguments, stock defaults (suno/bark-small,v2/en_speaker_6).
Job3a981606e49c— failed in 3.6 s, empty manifest,warnings: [].
validate_workflow passed both (valid: true, plan.steps: 3 / 1), so
there is no free pre-flight signal for this.
Expected vs. actual
- expected (S-F007): the chain completes, the final wav reports
duration_seconds: 1.5andsample_rate: 24000viaget_gallery_metadata,
with fades and a non-silent level. - actual:
status: "failed",manifest: [],
error: "Workflow execution error: BatchEncoding.to() got an unexpected keyword argument 'dtype'".
Traceback (from get_job("3a981606e49c"))
File "/home/don/diffusers-workflow/dw/tasks/task.py", line 395, in _handle_speech_generation
return generate_speech(text, device=task.device_for(arguments), **arguments)
File "/home/don/diffusers-workflow/dw/tasks/speech_generation.py", line 90, in generate_speech
output = pipe(
File ".../transformers/pipelines/text_to_audio.py", line 297, in __call__
return super().__call__(text_inputs, **forward_params)
File ".../transformers/pipelines/base.py", line 1302, in run_single
model_inputs = self.preprocess(inputs, **preprocess_params)
File ".../transformers/pipelines/text_to_audio.py", line 197, in preprocess
output = output.to(dtype=self.model.dtype)
TypeError: BatchEncoding.to() got an unexpected keyword argument 'dtype'
The failure is inside transformers' own text-to-audio pipeline, not in dw
code: TextToAudioPipeline.preprocess calls BatchEncoding.to(dtype=...), and
the installed BatchEncoding.to() does not accept dtype. From the consumer
side this reads as a dependency-version drift on lem — a transformers /
tokenizers pair that no longer agree — rather than a change in dw's own
logic. I can't check the installed versions (consumer-only isolation), so that
last part is inference from the traceback, not a verified claim.
Blast radius
templates/generate-speech— unusable.- S-F007 and S-P004 in the smoke suite — cannot run; no S-P004 timing was
recorded this run. - S-F024 part 4 names "a
generate_speechwav kept from S-F007" as one of its
possible inputs; I ran it against a shared-library asset instead. - Anything that voices a line with Bark —
templates/minimax/voice-timbre-reference
conditions H3's voice on a Bark-spoken line, so it is likely affected too (not
verified this run).
Note that #132 (closed wontfix) was about this same step being slow
(17.8 s). It is now not slow, because it does not run.
Repro artifacts
None kept — both failed runs wrote no media and their run directories were
swept with delete_output by the <workflow>/<run id> form. The repro is the
one-line call above and needs nothing from this workspace.
Activity
dkackman commentedon Sep 16, 2026
triage: work — real, reproducible from the traceback, and not fixed on develop (
dw/tasks/speech_generation.pyuntouched since #41; head is 3db782e). The failure is intransformersTextToAudioPipeline.preprocesscallingBatchEncoding.to(dtype=...), andpyproject.tomlpins onlytransformers>=5.16.1, so an unpinned upgrade on lem is the likely trigger. Not a duplicate: #132 was the same step being slow, closed completed. Self-contained; its own session should check the installed transformers/tokenizers versions on lem before deciding between a version pin and calling the model directly rather than through the pipeline. Triaged by model opus via provider anthropic.Merge fix for #169 - exclude transformers 5.17.0, breaks generate_speech
dkackman commentedon Sep 16, 2026
Fixed and deployed. Worked as model sonnet via provider anthropic.
Root cause: confirmed this is an upstream
transformersregression, not a dw bug.transformers5.17.0'sTextToAudioPipeline.preprocess()(transformers/pipelines/text_to_audio.py) added a calloutput.to(dtype=self.model.dtype), butBatchEncoding.to()(transformers/tokenization_utils_base.py) has never accepted adtypekwarg in either 5.16.1 or 5.17.0 - onlydeviceandnon_blocking. I verified this by diffing the installed 5.17.0 source onlemagainst a downloaded (not installed) 5.16.1 wheel's source for both files.Fix:
pyproject.toml- excluded the broken release:"transformers>=5.16.1,!=5.17.0"(commit84dae64, merged todevelopatf8d7452). Chose the version-pin path from the triage comment's fork rather than bypassing the pipeline, since 5.16.1 is proven to work with zero code changes.Verification:
lem's installedtransformersfrom 5.17.0 to 5.16.1.python -m dw.run workflows/templates/generate-speech.jsonwith no arguments - succeeded end-to-end, produced a real.wavfile.lem: 4881 passed, 14 skipped, 0 failed.Deploy: merged
fix/169-transformers-bark-dtype->develop(f8d7452), pulled ontolem'sdevelopcheckout, restarted the MCP server (three SIGINTs into thescreensession, relaunched viascreen -X stuff), confirmed healthy via/api/health(status: ok,worker_alive: falseis the normal lazy-start state, not a fault).Regression-suite proposal (for the tester to add to
regression-suite-smoke.mdonce verified - Bark speech generation is a basic, general-purpose capability and a silent regression here would be easy to miss):run_workflow(workflow_path="templates/generate-speech", acknowledged_cost=true)with no other arguments..wavwithsampling_rate~24000 Hz.dkackman commentedon Sep 16, 2026
Verified — closing. Run as model opus via provider anthropic (tester
agent, consumer-only over MCP), in a throwaway workspace
qa-verify-169,against
lem.1. The exact repro from the issue body — stock template, no arguments
validate_workflow(name="templates/generate-speech")→valid: true,plan.steps: 1(only the usual "no seed, step cache disabled" warning).run_workflow(workflow_path="templates/generate-speech", acknowledged_cost=true)— no
arguments, stock defaults (suno/bark-small,v2/en_speaker_6).Job
7beb9c394c8a→succeededin 17.4 s,warnings: [],error: null,manifest non-empty:
templates/generate-speech/20260916-033117-d2bcec8e/GenerateSpeech-speak.0-0.0.wav.get_gallery_metadataon that wav:Real audio at the expected 24 kHz, not a silent render. The
BatchEncoding.to() got an unexpected keyword argument 'dtype'TypeError is gone.2. Adjacent case — the S-F007 three-step chain that originally failed
Re-ran the case's own shape as an inline workflow:
generate_speech(same text/preset/model) →
slice_audiotovariable:clip_seconds= 1.5 →fade_audio(100 ms in/out), saving only the final step,seed: 42.validate_workflow→valid: true,plan.steps: 3, no elisions.Job
448d58bf3797→succeededin 9.4 s,warnings: []. Manifest isexactly the S-F007 expectation — the two unsaved steps report empty file lists
and only
fadedcarries a file:get_gallery_metadata(envelope=true)on the final wav:Both
expected:values from S-F007 land exactly (1.5 s, 24000 Hz), the level isnon-silent, and no parameter was dropped between steps. (The envelope is
reported at 1 s resolution, so it cannot resolve the 100 ms fades either way —
that is the tool's granularity, not a finding.)
So the fix holds for both the minimal template and the multi-step chain, which
covers the partial-fix case: it is not merely the one-step path that works.
Not covered this session
templates/minimax/voice-timbre-referencewas named in the blast radius aslikely affected. I did not run it — it is a paid H3 run and well beyond a verify
session's budget. The Bark step it conditions on is now working, so there is no
reason to expect it still fails, but that is inference, not a measurement.
Regression case
Adding the implementer's proposed case to
regression-suite-smoke.md(the stocktemplate on its own defaults, which is what S-F007's inline chain did not
cover — S-F007 would have kept passing while the catalog entry was unusable).
status:verified,status:fixed-pending-verifyremoved, closing as completed.fix(deps): #232 - revert transformers floor to >=5.16.1,!=5.17.0
Develop (#241)