Skip to content

Commit 03f6662

Browse files
committed
Define which classes use processor_config.json
1 parent 628d59f commit 03f6662

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/base/processing_utils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
*
2020
* @module processors
2121
*/
22+
import { PROCESSOR_NAME } from '../utils/constants.js';
2223
import {
2324
Callable,
2425
} from '../utils/generic.js';
26+
import { getModelJSON } from '../utils/hub.js';
2527

2628
/**
2729
* @typedef {Object} ProcessorProperties Additional processor-specific properties.
@@ -38,6 +40,7 @@ export class Processor extends Callable {
3840
'tokenizer_class',
3941
'feature_extractor_class',
4042
]
43+
static uses_processor_config = false;
4144

4245
/**
4346
* Creates a new Processor with the given components
@@ -110,8 +113,9 @@ export class Processor extends Callable {
110113

111114
const [config, components] = await Promise.all([
112115
// TODO:
113-
// getModelJSON(pretrained_model_name_or_path, PROCESSOR_NAME, true, options),
114-
{},
116+
this.uses_processor_config
117+
? getModelJSON(pretrained_model_name_or_path, PROCESSOR_NAME, true, options)
118+
: {},
115119
Promise.all(
116120
this.classes
117121
.filter((cls) => cls in this)

0 commit comments

Comments
 (0)