transformers.js
d874c90a - Minimal fixes for type declarations to resolve errors when importing transformers.js via typescript (partially resolves #1093) (#1122)

Commit
286 days ago
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 <admin@xenova.com>
Author
Parents
Loading