fix: Incorrect type annotations — use Optional[T] instead of T for nullable defaults
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- python
- Domain
- audio-video-rtc
Research direction
Read the affected annotations in src/voxcpm/modules/minicpm4/config.py, src/voxcpm/modules/locdit/local_dit.py, and src/voxcpm/core.py. Update each parameter that defaults to None to use Optional[T], then verify that all listed nullable parameters are annotated consistently for type checking.
Written by the indexing model from the issue text.
Description
Bug Report
Several parameters use bare type annotations with None as default value (e.g., int = None, str = None), which is incorrect. These should use Optional[T] = None to properly indicate nullable types per PEP 484.
Affected locations
-
src/voxcpm/modules/minicpm4/config.py (line 29):
kv_channels: int = None→kv_channels: Optional[int] = None
-
src/voxcpm/modules/locdit/local_dit.py (line 30):
out_dim: int = None→out_dim: Optional[int] = None
-
src/voxcpm/core.py (lines 109, 183–185):
cache_dir: str = None→cache_dir: Optional[str] = Noneprompt_wav_path: str = None→prompt_wav_path: Optional[str] = Noneprompt_text: str = None→prompt_text: Optional[str] = Nonereference_wav_path: str = None→reference_wav_path: Optional[str] = None
Expected behavior
All parameters that default to None should be annotated with Optional[T] for correct type checking.
- Dominant language
- Python
- Stars
- 37.8k
- Forks
- 4.3k
- Avg merge
- 7m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenBMB/VoxCPM
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
voice tts Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
中文合成问题 Open
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
nano-vllm-voxcpm问题反馈 Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100