8000 fix(jobs): skip transcribe and diarize for imported transcripts by adeelahmad · Pull Request #345 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

fix(jobs): skip transcribe and diarize for imported transcripts - #345

Merged
adeelahmad merged 1 commit into
mainfrom
claude/transcript-no-model-fetch-84ipr2
Oct 10, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/transcript-no-model-fetch-84ipr2

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: on a fresh install, importing a pasted transcript (or a transcript file without its audio) queued the standard pipeline from transcribe. The worker saw a queued job waiting for transcribe, fetched PyTorch and SenseVoice (about 1 GB) on first use, and held the job until the fetch finished, only for transcribe to skip with "an imported transcript has nothing to transcribe".

After: the job for an imported transcript starts at the steps that have work to do (analysis, embedding, summary, report). No speech or voice model is fetched for it, and analysis starts straight away.

How: jobs.for_source() already rewrote steps for documents and images. It now also drops transcribe and diarize for a transcript source. If those two are the only steps asked for (an explicit run, or a batch over mixed resources), they're kept, so the request still queues a job that says why it skips instead of failing with a 400.

Motivation and Context

Found by the clicks survey. It broke "light by default", since a Raspberry Pi install with cloud models should never download a local speech model to import text.

Steps to reproduce (if appropriate):

POST /api/v1/import {"namespace": "pods", "text": "[00:00] Ann: Hi."} on a fresh install. Before this change the job's next_step was transcribe, and Settings › Components showed PyTorch and SenseVoice being fetched.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit). Ruff check, ruff format and mypy are clean.
  • I added or updated tests. test_a_pasted_transcript_never_waits_for_a_speech_model fails on main (the steps start ['transcribe', 'diarize', 'shots', …]) and passes here. test_choosing_the_pipeline_that_runs_after now expects the standard pipeline without those two steps. The full backend suite passed locally: 920 passed, 18 skipped.
  • My change requires documentation updates, and I have updated docs/ accordingly (docs/api.md imports, docs/components.md). mkdocs build --strict is clean.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md. n/a: the title says it.

Done questions (AGENTS.md)

  • Goal: imports of pasted transcripts no longer fetch speech models. Merging on green.
  • Agents: the same path serves POST /import, the MCP and assistant import tools, and the CLI.
  • Zero setup: no new prerequisite.
  • Fewest clicks and keystrokes: n/a, nothing new to click.
  • Configurable: n/a, no new setting.
  • Light: this is the fix. A text-only install never downloads PyTorch or SenseVoice.
  • Private and secure: n/a, no new surface.
  • Cost: skips about 1 GB of downloads and the CPU time to load the models.
  • User decides: defaults unchanged. A run that asks only for transcribe or diarize still queues them.
  • Upgrades: no change to stored data. Transcript jobs queued before the upgrade run as before (see refine later).
  • Honest: docs describe only what this change does.
  • Tests, docs and generated files updated (no generated files are affected).
  • Open standards; no new dependencies.
  • Result reported with evidence; "refine later" items are in DEVLOG.md:
    • Transcript jobs queued before the upgrade still wait for the fetch once. A migration step would back up the whole database for a queue that drains on its own.
    • A run of only transcribe or diarize on a transcript still queues them, and may fetch the model.
    • A batch of only diarize over documents fails at enqueue. This is not new.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TKh8zrmfKCvPJhRiv6u9mY


Generated by Claude Code

A pasted or imported transcript (no audio) queued the standard pipeline from
transcribe, so a fresh install fetched PyTorch and SenseVoice (about 1 GB)
before analysing it, only for transcribe to skip. for_source now leaves both
steps out for a transcript source, as it does for documents and images.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKh8zrmfKCvPJhRiv6u9mY
@adeelahmad adeelahmad self-assigned this Oct 10, 2026
@adeelahmad
adeelahmad merged commit 5b2e8ac into main Oct 10, 2026
10 checks passed
@adeelahmad
adeelahmad deleted the claude/transcript-no-model-fetch-84ipr2 branch October 10, 2026 23:21
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.

2 participants

0