Skip to content

CI/CD#1

Merged
penfever merged 27 commits intomainfrom
working_branch2
Aug 24, 2025
Merged

CI/CD#1
penfever merged 27 commits intomainfrom
working_branch2

Conversation

@penfever
Copy link
Copy Markdown
Owner

No description provided.

@github-advanced-security
Copy link
Copy Markdown

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

dataset_id_hash = int(hashlib.md5(dataset_id_bytes).hexdigest()[:8], 16) % 10000
dataset_id_bytes = str(dataset["id"]).encode("utf-8")
dataset_id_hash = (
int(hashlib.md5(dataset_id_bytes).hexdigest()[:8], 16) % 10000

Check warning

Code scanning / Bandit

Use of insecure MD2, MD4, MD5, or SHA1 hash function. Warning

Use of insecure MD2, MD4, MD5, or SHA1 hash function.
results["metrics"][0]["y_ranges"] = y_ranges

num_categories = len(results["categories"][0])
assert len(full_texts) == (len(results["data"]["x_test"]) * num_categories)

Check notice

Code scanning / Bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
# check that y is categorical and there is only one y column
assert len(self.y_column_names) == 1
assert self.y_column_types[0] == 'categorical'
assert self.y_column_types[0] == "categorical"

Check notice

Code scanning / Bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Comment on lines +296 to +297
assert (
len(feature_names) == num_features

Check notice

Code scanning / Bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Comment on lines +186 to +187
assert (
abs(train_size + val_size + test_size - 1.0) < 1e-6

Check notice

Code scanning / Bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Note

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
try:
# Load model from torch.hub
model = torch.hub.load('facebookresearch/dinov2', model_name, pretrained=True)
model = torch.hub.load("facebookresearch/dinov2", model_name, pretrained=True)

Check warning

Code scanning / Bandit

Use of unsafe PyTorch load or save Warning

Use of unsafe PyTorch load or save

# Load the embedding projector
embedding_projector_path = f"{pretrained_model_path}/embedding_projector.pt"
if os.path.exists(embedding_projector_path):
model.embedding_projector.load_state_dict(torch.load(embedding_projector_path))
model.embedding_projector.load_state_dict(
torch.load(embedding_projector_path)

Check warning

Code scanning / Bandit

Use of unsafe PyTorch load or save Warning

Use of unsafe PyTorch load or save
Comment on lines +55 to +56
torch.save(
model.state_dict(), os.path.join(checkpoint_path, "pytorch_model.bin")

Check warning

Code scanning / Bandit

Use of unsafe PyTorch load or save Warning

Use of unsafe PyTorch load or save
cache_dir.mkdir(parents=True, exist_ok=True)

# Create a hash of the URL for the cache key
url_hash = hashlib.md5(url.encode()).hexdigest()[:16]

Check warning

Code scanning / Bandit

Use of insecure MD2, MD4, MD5, or SHA1 hash function. Warning

Use of insecure MD2, MD4, MD5, or SHA1 hash function.
from tqdm import tqdm

# Download with progress bar
response = requests.get(download_url, stream=True)

Check warning

Code scanning / Bandit

Call to requests without timeout Warning

Call to requests without timeout
import os
import logging
import os
import pickle

Check notice

Code scanning / Bandit

Consider possible security implications associated with pickle module. Note

Consider possible security implications associated with pickle module.
from parse_args import parse_command_line
import contextlib
import os
import pickle

Check notice

Code scanning / Bandit

Consider possible security implications associated with pickle module. Note

Consider possible security implications associated with pickle module.
import random
import subprocess

Check notice

Code scanning / Bandit

Consider possible security implications associated with the subprocess module. Note

Consider possible security implications associated with the subprocess module.
import random
import subprocess

Check notice

Code scanning / Bandit

Consider possible security implications associated with the subprocess module. Note

Consider possible security implications associated with the subprocess module.
import random
import subprocess

Check notice

Code scanning / Bandit

Consider possible security implications associated with the subprocess module. Note

Consider possible security implications associated with the subprocess module.
import random
import subprocess

Check notice

Code scanning / Bandit

Consider possible security implications associated with the subprocess module. Note

Consider possible security implications associated with the subprocess module.
import logging
import os
import random
import shutil
import subprocess

Check notice

Code scanning / Bandit

Consider possible security implications associated with the subprocess module. Note

Consider possible security implications associated with the subprocess module.
import time
from datetime import datetime
from tqdm import tqdm
import subprocess

Check notice

Code scanning / Bandit

Consider possible security implications associated with the subprocess module. Note

Consider possible security implications associated with the subprocess module.
import time
from datetime import datetime
from tqdm import tqdm
import subprocess

Check notice

Code scanning / Bandit

Consider possible security implications associated with the subprocess module. Note

Consider possible security implications associated with the subprocess module.
@penfever penfever marked this pull request as ready for review August 24, 2025 18:33
Benjamin Feuer added 2 commits August 24, 2025 14:45
Benjamin Feuer added 2 commits August 24, 2025 14:49
@penfever penfever merged commit 525f821 into main Aug 24, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants