Kotasai2002 commited on
Commit
f9b37b2
·
1 Parent(s): a44e23b

Upload 2 files

Browse files
Files changed (2) hide show
  1. __init__.py +7 -0
  2. scan.py +25 -0
__init__.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from modelscan.models.h5.scan import H5Scan
2
+ from modelscan.models.pickle.scan import (
3
+ PickleScan,
4
+ NumpyScan,
5
+ PyTorchScan,
6
+ )
7
+ from modelscan.models.saved_model.scan import SavedModelScan
scan.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import abc
2
+ from pathlib import Path
3
+ from typing import List, Tuple, Union, Optional, IO
4
+
5
+ from modelscan.error import Error
6
+ from modelscan.issues import Issue
7
+
8
+
9
+ class ScanBase(metaclass=abc.ABCMeta):
10
+ @staticmethod
11
+ @abc.abstractmethod
12
+ def name() -> str:
13
+ raise NotImplementedError
14
+
15
+ @staticmethod
16
+ @abc.abstractmethod
17
+ def scan(
18
+ source: Union[str, Path], data: Optional[IO[bytes]] = None
19
+ ) -> Tuple[List[Issue], List[Error]]:
20
+ raise NotImplementedError
21
+
22
+ @staticmethod
23
+ @abc.abstractmethod
24
+ def supported_extensions() -> List[str]:
25
+ raise NotImplementedError