Skip to content

fix: allow topic segmentation without precompression - #75

Open
JiataiWang wants to merge 1 commit into
zjunlp:mainfrom
JiataiWang:fix/topic-segment-without-precompress
Open

fix: allow topic segmentation without precompression#75
JiataiWang wants to merge 1 commit into
zjunlp:mainfrom
JiataiWang:fix/topic-segment-without-precompress

Conversation

@JiataiWang

Copy link
Copy Markdown

What broke

pre_compress and topic_segment are documented as independent options, but enabling topic segmentation without pre-compression crashes during LightMemory initialization because self.compressor is only assigned inside the pre-compression branch and then passed unconditionally to the segmenter factory.

Fix

Initialize the optional compressor to None; when pre-compression is enabled, the real compressor still replaces it. Topic segmentation can then initialize normally without pre-compression.

Test

uv sync --extra dev
uv run --project . python -m pytest -q tests/test_lightmemory_initialization.py tests/test_sensory_memory.py

Result: 3 passed.

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