Skip to content

fix(novel2movie): avoid ZeroDivisionError on empty novel text#71

Open
santhreal wants to merge 2 commits into
HKUDS:mainfrom
santhreal:fix/novel2movie-empty-ratio-v2
Open

fix(novel2movie): avoid ZeroDivisionError on empty novel text#71
santhreal wants to merge 2 commits into
HKUDS:mainfrom
santhreal:fix/novel2movie-empty-ratio-v2

Conversation

@santhreal

Copy link
Copy Markdown

The novel2movie compression summary divided by len(novel_text) with no empty guard. An empty novel (or resume with an empty compressed artifact) raised ZeroDivisionError before later steps.

compression_ratio_label now prints n/a when the novel text is empty.

Repro: compression_ratio_label("", "") must not divide by zero; it returns the n/a label.

Compression summary divided by len(novel_text) with no empty guard.
Print n/a via a small helper when the novel is empty.
Keep only compression_ratio_label assertions.
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