abetlen/llama-cpp-python

suppress_stdout_stderr failing in notebooks

已關閉

#872 建立於 2023年11月5日

 (3 則留言) (0 個反應) (0 位負責人)Python (1,441 個分叉)batch import
bughelp wanted

倉庫指標

星標
 (10,557 顆星)
PR 合併指標
 (平均合併 1天 5小時) (30 天內合併 68 個 PR)

描述

Expected Behavior

Loading a model with verbose=False should not print things.

Current Behavior

verbose=False has no effect in notebooks (I tested with VS Code notebooks, but I think it is ipykernel related)

Steps to Reproduce

Just load a model with verbose=False and observe output in a notebook environment.

How to fix

The patch given in the ipykernel issue below fixes the issue for me (but requires me to do my own override of stdout and stderr since the patch also causes suppress_stdout_stderr to crash as currently written). A real fix might involve integrating this into suppress_stdout_stderr directly.

https://github.com/ipython/ipykernel/issues/795

thanks!

貢獻者指南