Skip to content

Commit ac2493a

Browse files
committed
Merge branch 'main' into support-classifier-attentions
2 parents 36ef7c7 + d874c90 commit ac2493a

File tree

5 files changed

+12
-44
lines changed

5 files changed

+12
-44
lines changed

src/base/feature_extraction_utils.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ export class FeatureExtractor extends Callable {
1717
}
1818

1919
/**
20-
* Instantiate one of the processor classes of the library from a pretrained model.
20+
* Instantiate one of the feature extractor classes of the library from a pretrained model.
2121
*
22-
* The processor class to instantiate is selected based on the `image_processor_type` (or `feature_extractor_type`; legacy)
23-
* property of the config object (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)
22+
* The feature extractor class to instantiate is selected based on the `feature_extractor_type` property of
23+
* the config object (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)
2424
*
2525
* @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:
26-
* - A string, the *model id* of a pretrained processor hosted inside a model repo on huggingface.co.
26+
* - A string, the *model id* of a pretrained feature_extractor hosted inside a model repo on huggingface.co.
2727
* Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a
2828
* user or organization name, like `dbmdz/bert-base-german-cased`.
29-
* - A path to a *directory* containing processor files, e.g., `./my_model_directory/`.
30-
* @param {import('../utils/hub.js').PretrainedOptions} options Additional options for loading the processor.
29+
* - A path to a *directory* containing feature_extractor files, e.g., `./my_model_directory/`.
30+
* @param {import('../utils/hub.js').PretrainedOptions} options Additional options for loading the feature_extractor.
3131
*
32-
* @returns {Promise<FeatureExtractor>} A new instance of the Processor class.
32+
* @returns {Promise<FeatureExtractor>} A new instance of the Feature Extractor class.
3333
*/
3434
static async from_pretrained(pretrained_model_name_or_path, options) {
35-
const preprocessorConfig = await getModelJSON(pretrained_model_name_or_path, FEATURE_EXTRACTOR_NAME, true, options);
36-
return new this(preprocessorConfig);
35+
const config = await getModelJSON(pretrained_model_name_or_path, FEATURE_EXTRACTOR_NAME, true, options);
36+
return new this(config);
3737
}
3838
}
3939

src/base/processing_utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ export class Processor extends Callable {
121121
/**
122122
* Instantiate one of the processor classes of the library from a pretrained model.
123123
*
124-
* The processor class to instantiate is selected based on the `feature_extractor_type` property of the config object
125-
* (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)
124+
* The processor class to instantiate is selected based on the `image_processor_type` (or `feature_extractor_type`; legacy)
125+
* property of the config object (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)
126126
*
127127
* @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:
128128
* - A string, the *model id* of a pretrained processor hosted inside a model repo on huggingface.co.

src/models/auto/feature_extraction_auto.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,6 @@ import * as AllFeatureExtractors from '../feature_extractors.js';
66

77
export class AutoFeatureExtractor {
88

9-
/**
10-
* Instantiate one of the feature extractor classes of the library from a pretrained model.
11-
*
12-
* The processor class to instantiate is selected based on the `feature_extractor_type` property of
13-
* the config object (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)
14-
*
15-
* @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:
16-
* - A string, the *model id* of a pretrained processor hosted inside a model repo on huggingface.co.
17-
* Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a
18-
* user or organization name, like `dbmdz/bert-base-german-cased`.
19-
* - A path to a *directory* containing processor files, e.g., `./my_model_directory/`.
20-
* @param {import('../../utils/hub.js').PretrainedOptions} options Additional options for loading the processor.
21-
*
22-
* @returns {Promise<AllFeatureExtractors.ImageProcessor>} A new instance of the Processor class.
23-
*/
24-
259
/** @type {typeof FeatureExtractor.from_pretrained} */
2610
static async from_pretrained(pretrained_model_name_or_path, options={}) {
2711

src/models/auto/processing_auto.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,6 @@ import * as AllFeatureExtractors from '../feature_extractors.js';
4040
*/
4141
export class AutoProcessor {
4242

43-
/**
44-
* Instantiate one of the processor classes of the library from a pretrained model.
45-
*
46-
* The processor class to instantiate is selected based on the `image_processor_type` (or `feature_extractor_type`; legacy)
47-
* property of the config object (either passed as an argument or loaded from `pretrained_model_name_or_path` if possible)
48-
*
49-
* @param {string} pretrained_model_name_or_path The name or path of the pretrained model. Can be either:
50-
* - A string, the *model id* of a pretrained processor hosted inside a model repo on huggingface.co.
51-
* Valid model ids can be located at the root-level, like `bert-base-uncased`, or namespaced under a
52-
* user or organization name, like `dbmdz/bert-base-german-cased`.
53-
* - A path to a *directory* containing processor files, e.g., `./my_model_directory/`.
54-
* @param {import('../../utils/hub.js').PretrainedOptions} options Additional options for loading the processor.
55-
*
56-
* @returns {Promise<Processor>} A new instance of the Processor class.
57-
*/
58-
5943
/** @type {typeof Processor.from_pretrained} */
6044
static async from_pretrained(pretrained_model_name_or_path, options={}) {
6145

src/models/phi3_v/processing_phi3_v.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class Phi3VProcessor extends Processor {
1414
*
1515
* @param {string|string[]} text
1616
* @param {RawImage|RawImage[]} images
17-
* @param {...any} args
17+
* @param { { padding?: boolean, truncation?: boolean, num_crops?: number } | undefined } options
1818
* @returns {Promise<any>}
1919
*/
2020
async _call(text, images = null, {

0 commit comments

Comments
 (0)