Abid Ali Awan commited on
Commit
182bd23
·
1 Parent(s): b000f83

Refactor app.py to suppress logging warnings by setting verbosity to error, improving the clarity of the application output.

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -2,11 +2,9 @@ import gradio as gr
2
  import spaces
3
  import torch
4
  import numpy as np
5
- from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
6
- import warnings
7
 
8
- # Suppress warnings
9
- warnings.filterwarnings("ignore")
10
 
11
  # Model configuration
12
  device = "cuda:0" if torch.cuda.is_available() else "cpu"
 
2
  import spaces
3
  import torch
4
  import numpy as np
5
+ from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline, logging
 
6
 
7
+ logging.set_verbosity_error()
 
8
 
9
  # Model configuration
10
  device = "cuda:0" if torch.cuda.is_available() else "cpu"