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

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.

@JiataiWang

Copy link
Copy Markdown
Author

Hi, gentle check-in when you have a chance. This remains a small, conflict-free fix for topic segmentation when precompression is disabled; current main still reads self.compressor.config without initializing self.compressor on that path. The regression stays scoped to that case. Happy to rebase or adjust anything needed.

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