@@ -280,6 +280,29 @@ class Tokenizer::TokenizerImpl {
280
280
setup_tokenizer (models, properties);
281
281
}
282
282
283
+ void filter_properties (ov::AnyMap& properties) {
284
+ // Properties allowed for tokenizer/detokenizer on CPU
285
+ std::set<std::string> allowed_argnames = {
286
+ ov::hint::performance_mode.name (),
287
+ ov::hint::num_requests.name (),
288
+ ov::hint::enable_cpu_pinning.name (),
289
+ ov::hint::execution_mode.name (),
290
+ ov::hint::compiled_blob.name (),
291
+ ov::hint::enable_hyper_threading.name (),
292
+ ov::hint::enable_cpu_reservation.name (),
293
+ ov::enable_profiling.name (),
294
+ };
295
+
296
+ for (auto prop_it = properties.begin (); prop_it != properties.end ();) {
297
+ auto it = allowed_argnames.find (prop_it->first );
298
+ if (it == allowed_argnames.end ()) {
299
+ prop_it = properties.erase (prop_it);
300
+ } else {
301
+ ++prop_it;
302
+ }
303
+ }
304
+ }
305
+
283
306
void setup_tokenizer (const std::filesystem::path& models_path, const ov::AnyMap& properties) {
284
307
ScopedVar env_manager (tokenizers_relative_to_genai ());
285
308
auto core = get_core_singleton ();
@@ -369,9 +392,9 @@ class Tokenizer::TokenizerImpl {
369
392
two_input_requested = it->second .as <bool >();
370
393
properties.erase (it);
371
394
}
372
-
373
- // Pass no addtional properties to tokenizer/detokenizer models since it was not used by default
374
- properties = {} ;
395
+
396
+ // Filter properties by leaving only params from the allowlist
397
+ filter_properties ( properties) ;
375
398
376
399
is_paired_input = ov_tokenizer && ov_tokenizer->get_parameters ().size () == 2 ;
377
400
0 commit comments