-
Notifications
You must be signed in to change notification settings - Fork 837
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minimal fixes for type declarations to resolve errors when importing …
…transformers.js via typescript (partially resolves #1093) (#1122) * Explicitly declare `batch_decode` as a function with polymorphic args/returns Resolves typescript inference errors in `models/mgp_str/processing_mgp_str.js` where it does extend from `Processor` but the override returns an object instead of a string array. * Directly refer to `PretrainedProcessorOptions` in typedec for `AutoProcessor.from_pretrained` Resolves an issue with tsc where using `@type {typeof Processor.from_pretrained}` does not actually import the `PretrainedProcessorOptions` type alias defined in `processing_utils.js`. * Explicitly define third argument for Phi3VProcessor._call Resolves a typescript error where typescript tries to destructure an array directly into padding/truncation/num_crops. Also improves the type safety of calling this function. * Fix decode type * Re-use `from_pretrained` types where possible --------- Co-authored-by: Joshua Lochner <[email protected]>
- Loading branch information
Showing
6 changed files
with
13 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters