Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve typing of pipeline helper function #485

Merged
merged 35 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b2d3dd9
Improve typing of `pipeline` helper function
xenova Dec 29, 2023
0344e36
Overhaul image pipeline types
xenova Dec 29, 2023
4d45efa
Improve typing
xenova Dec 29, 2023
58dba44
Fix export
xenova Dec 29, 2023
37d91d7
Do not require separate proxy object
xenova Dec 29, 2023
8fbc74c
Update text classification pipeline types
xenova Dec 29, 2023
ed6844c
Fix calls to base pipeline
xenova Dec 29, 2023
1d7705f
Improve inheritance
xenova Dec 29, 2023
d783c2f
Fix JSDoc
xenova Dec 29, 2023
920bb57
Update token classification pipeline typing
xenova Dec 30, 2023
027d7a9
Update question answering pipeline
xenova Dec 30, 2023
c42a2a9
Update fill-mask pipeline
xenova Dec 30, 2023
48dbcfe
Fix JSDoc
xenova Dec 30, 2023
cb472c7
Improve generation config typing
xenova Dec 30, 2023
6cf29ae
Update text2text generation pipeline
xenova Dec 30, 2023
6fb5011
Fix generation config type
xenova Dec 30, 2023
0ab776c
Update summarization and translation pipelines
xenova Dec 30, 2023
f44f7c7
Update text generation pipeline types
xenova Dec 30, 2023
fdfbd9e
Update zero-shot classification pipeline types
xenova Dec 30, 2023
679f9e1
Update feature extraction pipeline types
xenova Dec 30, 2023
9e8cf7c
Update audio pipeline types
xenova Dec 31, 2023
ad5b739
Fix generation config types
xenova Dec 31, 2023
6e24bf4
Improve pipeline constructor types
xenova Dec 31, 2023
5383e4a
Update image to text pipeline types
xenova Dec 31, 2023
c2dde81
Update image classification pipeline types
xenova Dec 31, 2023
d25f6f0
Update zero-shot image classification pipeline types
xenova Dec 31, 2023
afcecd7
Update ImageSegmentationPipeline constructor type
xenova Dec 31, 2023
844dd98
Update object detection pipeline types
xenova Dec 31, 2023
713e00f
Update zero-shot object detection pipeline types
xenova Dec 31, 2023
1aca374
Update document question answering pipeline types
xenova Dec 31, 2023
70cb235
Update text-to-audio pipeline types
xenova Jan 1, 2024
c157892
Update image-to-image pipeline types
xenova Jan 1, 2024
38e7d22
Update depth estimation pipeline types
xenova Jan 1, 2024
3a692a9
Improve return JSDoc
xenova Jan 1, 2024
42a2318
Improve example pipeline JSDoc
xenova Jan 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ export class PreTrainedModel extends Callable {
}

/**
* @param {GenerationConfig} generation_config
* @param {import('./utils/generation.js').GenerationConfigType} generation_config
* @param {number} input_ids_seq_length The starting sequence length for the input ids.
* @returns {LogitsProcessorList}
* @private
Expand Down Expand Up @@ -943,9 +943,8 @@ export class PreTrainedModel extends Callable {
/**
* This function merges multiple generation configs together to form a final generation config to be used by the model for text generation.
* It first creates an empty `GenerationConfig` object, then it applies the model's own `generation_config` property to it. Finally, if a `generation_config` object was passed in the arguments, it overwrites the corresponding properties in the final config with those of the passed config object.
*
* @param {GenerationConfig} generation_config A `GenerationConfig` object containing generation parameters.
* @returns {GenerationConfig} The final generation config object to be used by the model for text generation.
* @param {import('./utils/generation.js').GenerationConfigType} generation_config A `GenerationConfig` object containing generation parameters.
* @returns {import('./utils/generation.js').GenerationConfigType} The final generation config object to be used by the model for text generation.
*/
_get_generation_config(generation_config) {
// Create empty generation config (contains defaults)
Expand Down
Loading
Loading