From d3c73735f8d1ebe718032f87389563430620f938 Mon Sep 17 00:00:00 2001 From: Davidqian123 Date: Mon, 25 Nov 2024 07:27:51 +0000 Subject: [PATCH] suppress log print in streamlit --- nexa/gguf/streamlit/streamlit_audio_lm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nexa/gguf/streamlit/streamlit_audio_lm.py b/nexa/gguf/streamlit/streamlit_audio_lm.py index 648e1a89..889a8870 100644 --- a/nexa/gguf/streamlit/streamlit_audio_lm.py +++ b/nexa/gguf/streamlit/streamlit_audio_lm.py @@ -7,6 +7,7 @@ from st_audiorec import st_audiorec from nexa.general import pull_model +from nexa.gguf.llama._utils_transformers import suppress_stdout_stderr from nexa.gguf.nexa_inference_audio_lm import NexaAudioLMInference # Initialize session state @@ -45,7 +46,8 @@ def process_audio(nexa_model, audio_file, prompt=""): try: # Use the model's inference method directly - response = nexa_model.inference(temp_audio_path, prompt) + with suppress_stdout_stderr(): + response = nexa_model.inference(temp_audio_path, prompt) return response except Exception as e: