Skip to content

Commit f826e3c

Browse files
committed
checks
1 parent 8463c94 commit f826e3c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tools/model_converter/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ python model_converter.py config.json -o ./output_models
3535

3636
### Command-Line Options
3737

38-
```
38+
```text
3939
positional arguments:
4040
config Path to JSON configuration file
4141

tools/model_converter/model_converter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def download_weights(self, url: str, filename: Optional[str] = None) -> Path:
9191
self.logger.info(f"Saving to: {cached_file}")
9292

9393
try:
94-
urllib.request.urlretrieve(url, cached_file)
94+
urllib.request.urlretrieve(url, cached_file) # nosemgrep: python.lang.security.audit.dynamic-urllib-use-detected.dynamic-urllib-use-detected
9595
self.logger.info("✓ Download complete")
9696
return cached_file
9797
except Exception as e:
@@ -111,7 +111,7 @@ def load_model_class(self, class_path: str) -> type:
111111
try:
112112
module_path, class_name = class_path.rsplit(".", 1)
113113
self.logger.debug(f"Importing module: {module_path}")
114-
module = importlib.import_module(module_path)
114+
module = importlib.import_module(module_path) # nosemgrep: python.lang.security.audit.non-literal-import.non-literal-import
115115
model_class = getattr(module, class_name)
116116
self.logger.debug(f"Loaded class: {class_name}")
117117
return model_class
@@ -130,7 +130,7 @@ def load_checkpoint(self, checkpoint_path: Path) -> Dict[str, Any]:
130130
Checkpoint dictionary
131131
"""
132132
try:
133-
checkpoint = torch.load(checkpoint_path, map_location="cpu", weights_only=True)
133+
checkpoint = torch.load(checkpoint_path, map_location="cpu", weights_only=True) # nosemgrep: trailofbits.python.pickles-in-pytorch.pickles-in-pytorch
134134
self.logger.debug(f"Loaded checkpoint from: {checkpoint_path}")
135135
return checkpoint
136136
except Exception as e:

0 commit comments

Comments
 (0)