Skip to content

Commit aabb290

Browse files
authored
Fix optional from_pretrained types (#1352)
1 parent 7b45042 commit aabb290

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/base/feature_extraction_utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class FeatureExtractor extends Callable {
3131
*
3232
* @returns {Promise<FeatureExtractor>} A new instance of the Feature Extractor class.
3333
*/
34-
static async from_pretrained(pretrained_model_name_or_path, options) {
34+
static async from_pretrained(pretrained_model_name_or_path, options={}) {
3535
const config = await getModelJSON(pretrained_model_name_or_path, FEATURE_EXTRACTOR_NAME, true, options);
3636
return new this(config);
3737
}

src/base/image_processors_utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ export class ImageProcessor extends Callable {
10981098
*
10991099
* @returns {Promise<ImageProcessor>} A new instance of the Processor class.
11001100
*/
1101-
static async from_pretrained(pretrained_model_name_or_path, options) {
1101+
static async from_pretrained(pretrained_model_name_or_path, options={}) {
11021102
const preprocessorConfig = await getModelJSON(pretrained_model_name_or_path, IMAGE_PROCESSOR_NAME, true, options);
11031103
return new this(preprocessorConfig);
11041104
}

src/base/processing_utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class Processor extends Callable {
148148
*
149149
* @returns {Promise<Processor>} A new instance of the Processor class.
150150
*/
151-
static async from_pretrained(pretrained_model_name_or_path, options) {
151+
static async from_pretrained(pretrained_model_name_or_path, options={}) {
152152

153153
const [config, components, chat_template] = await Promise.all([
154154
// TODO:

0 commit comments

Comments
 (0)