fix precommit

This commit is contained in:
cotran 2024-10-16 16:49:44 -07:00
parent 953b1b056b
commit b5d2f19d9b
4 changed files with 119 additions and 7 deletions

View file

@ -5,13 +5,7 @@ import app.commons.globals as glb
from app.loader import get_embedding_model, get_zero_shot_model, get_prompt_guard
# Mock constants
if torch.cuda.is_available():
DEVICE = "cuda"
elif hasattr(torch.backends, "mps") and torch.backends.mps.is_available():
DEVICE = "mps"
else:
DEVICE = "cpu"
glb.DEVICE = DEVICE # Adjust as needed for your test case
glb.DEVICE = "cuda" # Adjust as needed for your test case
arch_guard_model_type = {
"cpu": "katanemo/Arch-Guard-cpu",
"cuda": "katanemo/Arch-Guard",