abetlen/llama-cpp-python

suppress_stdout_stderr failing in notebooks

Fechada

#872 aberto em 5 de nov. de 2023

 (3 comentários) (0 reação) (0 responsável)Python (1.441 forks)batch import
bughelp wanted

Métricas do repositório

Stars
 (10.557 estrelas)
Métricas de merge de PR
 (Mesclagem média 1d 5h) (68 fundiu PRs em 30d)

Description

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!

Guia do colaborador