Abid Ali Awan commited on
Commit
9f507de
·
1 Parent(s): 087adaa

Enhance app.py by adding a warning filter to suppress deprecation messages related to input naming, improving code clarity and future compatibility.

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -1,12 +1,20 @@
1
  import os
 
 
2
  import gradio as gr
3
- import torch
4
  import numpy as np
 
5
  from transformers import (
6
  AutoModelForSpeechSeq2Seq,
7
  AutoProcessor,
8
- pipeline,
9
  logging,
 
 
 
 
 
 
 
10
  )
11
 
12
  # —— CPU performance tweaks ——
 
1
  import os
2
+ import warnings
3
+
4
  import gradio as gr
 
5
  import numpy as np
6
+ import torch
7
  from transformers import (
8
  AutoModelForSpeechSeq2Seq,
9
  AutoProcessor,
 
10
  logging,
11
+ pipeline,
12
+ )
13
+
14
+ warnings.filterwarnings(
15
+ "ignore",
16
+ message="The input name `inputs` is deprecated. Please make sure to use `input_features` instead.",
17
+ category=FutureWarning,
18
  )
19
 
20
  # —— CPU performance tweaks ——