yunusajib commited on
Commit
1e4a4a4
·
verified ·
1 Parent(s): 5f2ef5e

update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -4,11 +4,13 @@ import tempfile
4
  import gradio as gr
5
  from ultralytics import YOLO
6
  from ultralytics.nn.tasks import DetectionModel
 
7
 
8
- # Add both necessary classes to the safe globals list
9
  torch.serialization.add_safe_globals([
10
  DetectionModel,
11
- torch.nn.modules.container.Sequential
 
12
  ])
13
 
14
  # Load the YOLO model
 
4
  import gradio as gr
5
  from ultralytics import YOLO
6
  from ultralytics.nn.tasks import DetectionModel
7
+ from ultralytics.nn.modules.conv import Conv
8
 
9
+ # Add all the classes we've seen so far to the safe globals list
10
  torch.serialization.add_safe_globals([
11
  DetectionModel,
12
+ torch.nn.modules.container.Sequential,
13
+ Conv
14
  ])
15
 
16
  # Load the YOLO model