@@ -126,7 +126,10 @@ def custom_benchmark(self) -> str:
126
126
127
127
@custom_benchmark .setter
128
128
def custom_benchmark (self , value : str ):
129
- if not value : raise ValueError ("Custom benchmark file cannot be empty, has to be a path to file" )
129
+ if not value : #raise ValueError("Custom benchmark file cannot be empty, has to be a path to file")
130
+ self .config_state ['custom_benchmark' ] = value
131
+ self .save ()
132
+ return
130
133
if not os .path .exists (value ): raise ValueError ("Custom benchmark file does not exist" )
131
134
if not os .path .isfile (value ): raise ValueError ("Custom benchmark file is not a file" )
132
135
if not os .access (value , os .R_OK ): raise ValueError ("Custom benchmark file is not readable" )
@@ -208,7 +211,7 @@ def parse_cmdline_args():
208
211
parser .add_argument ('--attack-model' , type = str , default = None , help = "Attack model" )
209
212
parser .add_argument ('--target-provider' , type = str , default = None , help = "Target provider" )
210
213
parser .add_argument ('--target-model' , type = str , default = None , help = "Target model" )
211
- parser .add_argument ('--custom-benchmark' , type = str , default = None , help = "Custom benchmark file" )
214
+ parser .add_argument ('--custom-benchmark' , type = str , default = '' , help = "Custom benchmark file" )
212
215
parser .add_argument ('--tests' , type = str , default = '' , help = "Custom test configuration (LIST)" )
213
216
parser .add_argument ('-n' , '--num-attempts' , type = int , default = None , help = "Number of different attack prompts" )
214
217
parser .add_argument ('-t' , '--num-threads' , type = int , default = None , help = "Number of worker threads" )
0 commit comments