saritha commited on
Commit
ea04b3d
·
verified ·
1 Parent(s): ae1742e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -8,8 +8,8 @@ import os
8
  import contextlib
9
  from transformers import ViTForImageClassification
10
 
11
- # Suppress warnings related to the model weights initialization, FutureWarning and UserWarnings
12
- warnings.filterwarnings("ignore", category=UserWarning, module="transformers")
13
  warnings.filterwarnings("ignore", category=FutureWarning, module="torch")
14
 
15
  # Suppress output for copying files and verbose model initialization messages
@@ -66,7 +66,6 @@ demo_app = gr.Interface(
66
  outputs=outputs,
67
  title="Sugarcane Disease Detection",
68
  examples=EXAMPLES,
69
- cache_example=True,
70
  live=True,
71
  theme="huggingface"
72
  )
@@ -74,3 +73,4 @@ demo_app = gr.Interface(
74
  demo_app.launch(debug=True, enable_queue=True)
75
 
76
 
 
 
8
  import contextlib
9
  from transformers import ViTForImageClassification
10
 
11
+ # Suppress warnings related to the model weights initialization
12
+ warnings.filterwarnings("ignore", category=UserWarning, message=".*weights.*")
13
  warnings.filterwarnings("ignore", category=FutureWarning, module="torch")
14
 
15
  # Suppress output for copying files and verbose model initialization messages
 
66
  outputs=outputs,
67
  title="Sugarcane Disease Detection",
68
  examples=EXAMPLES,
 
69
  live=True,
70
  theme="huggingface"
71
  )
 
73
  demo_app.launch(debug=True, enable_queue=True)
74
 
75
 
76
+