File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ def device_name(self):
42
42
43
43
def load (self ):
44
44
kwargs = {
45
- "device" : self .device_name
45
+ "device" : self .device_name ,
46
+ "use_local" : True
46
47
}
47
48
read_from = os .environ .get ("MODEL_PATH" , "s3" ).lower ()
48
49
if read_from == "s3" :
Original file line number Diff line number Diff line change @@ -77,6 +77,15 @@ def __init__(
77
77
self .embedding_model = None
78
78
self .known_malicious_embeddings = []
79
79
80
+ # It's possible for self.use_local to be unset and in some indeterminate state.
81
+ # First take use_local as a kwarg as the truth.
82
+ # If that's not present, try self.use_local.
83
+ # If that's not present, default to true.
84
+ if "use_local" in kwargs :
85
+ self .use_local = kwargs ["use_local" ]
86
+ elif self .use_local is None :
87
+ self .use_local = True
88
+
80
89
if self .use_local :
81
90
if not model_path_override :
82
91
self .saturation_attack_detector = PromptSaturationDetectorV3 (
You can’t perform that action at this time.
0 commit comments