Skip to content

fix: keep FunASR server noise out of app logs - #65

Open
LauraGPT wants to merge 2 commits into
yan5xu:mainfrom
LauraGPT:codex/fix-funasr-log-noise
Open

fix: keep FunASR server noise out of app logs#65
LauraGPT wants to merge 2 commits into
yan5xu:mainfrom
LauraGPT:codex/fix-funasr-log-noise

Conversation

@LauraGPT

Copy link
Copy Markdown

Summary

  • keep the Python FunASR server log handler file-only so INFO logs do not enter Electron stderr
  • suppress third-party stdout/stderr around FunASR model loading, VAD/ASR/PUNC generation, and duration probing
  • add a regression test that simulates Chinese stdout/stderr noise and tqdm-style progress output from model calls

Why

Closes #64. The Python server uses stdout as the JSON IPC channel, while Electron currently records stderr as FunASR error output. FunASR/modelscope/tqdm progress lines and Python INFO logs can therefore pollute the app logs and appear as mojibake on Windows even though transcription succeeds.

Verification

  • python3 -m unittest test_funasr_log_noise -v
  • python3 -m compileall -q funasr_server.py test_funasr_log_noise.py
  • git diff --check

@LauraGPT

Copy link
Copy Markdown
Author

Updated this PR at exact head 01b431a after rechecking the FunASR server path.

Additional fix:

  • made suppress_console_output() safe for overlapping calls from the parallel ASR/VAD/punctuation model-loading threads, so one loader cannot restore sys.stdout / sys.stderr to another loader's closed devnull stream;
  • added a regression test for overlapping suppression plus the original noisy FunASR model-output case.

Validation on the current head:

python -m pytest test_funasr_log_noise.py -q
python -m py_compile funasr_server.py test_funasr_log_noise.py
git diff --check origin/main...HEAD

Result: 2 passed; compile and whitespace checks passed. The only warning is from the host's installed SciPy/librosa/NumPy combination and is not related to this patch.

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