freddyaboulton HF staff commited on
Commit
36935e6
·
verified ·
1 Parent(s): 01426a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -10,6 +10,23 @@ import os
10
  import spaces
11
  from transformers import Qwen2AudioForConditionalGeneration, AutoProcessor
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  processor = AutoProcessor.from_pretrained("Qwen/Qwen2-Audio-7B-Instruct")
14
  model = Qwen2AudioForConditionalGeneration.from_pretrained("Qwen/Qwen2-Audio-7B-Instruct", device_map="auto")
15
 
 
10
  import spaces
11
  from transformers import Qwen2AudioForConditionalGeneration, AutoProcessor
12
 
13
+ # Configure the root logger to WARNING to suppress debug messages from other libraries
14
+ logging.basicConfig(level=logging.WARNING)
15
+
16
+ # Create a console handler
17
+ console_handler = logging.StreamHandler()
18
+ console_handler.setLevel(logging.DEBUG)
19
+
20
+ # Create a formatter
21
+ formatter = logging.Formatter("%(name)s - %(levelname)s - %(message)s")
22
+ console_handler.setFormatter(formatter)
23
+
24
+ # Configure the logger for your specific library
25
+ logger = logging.getLogger("gradio_webrtc")
26
+ logger.setLevel(logging.DEBUG)
27
+ logger.addHandler(console_handler)
28
+
29
+
30
  processor = AutoProcessor.from_pretrained("Qwen/Qwen2-Audio-7B-Instruct")
31
  model = Qwen2AudioForConditionalGeneration.from_pretrained("Qwen/Qwen2-Audio-7B-Instruct", device_map="auto")
32