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

v3: v3testing continuing code execution #746

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -3000,7 +3000,7 @@ export class WhisperForConditionalGeneration extends WhisperPreTrainedModel {

...kwargs
}) {
throw new Error("WhisperForConditionalGeneration.generate is not yet in Transformers.js v3.")
if(!globalThis.v3testing) throw new Error("WhisperForConditionalGeneration.generate is not yet in Transformers.js v3.")

// console.log('inputs', inputs);
// console.log('kwargs', kwargs);
Expand Down
12 changes: 6 additions & 6 deletions src/pipelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ export class Text2TextGenerationPipeline extends (/** @type {new (options: TextP

/** @type {Text2TextGenerationPipelineCallback} */
async _call(texts, generate_kwargs = {}) {
throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented
if(!globalThis.v3testing) throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented
if (!Array.isArray(texts)) {
texts = [texts];
}
Expand Down Expand Up @@ -930,7 +930,7 @@ export class TextGenerationPipeline extends (/** @type {new (options: TextPipeli

/** @type {TextGenerationPipelineCallback} */
async _call(texts, generate_kwargs = {}) {
throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented
if(!globalThis.v3testing) throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented
let isBatched = false;
let isChatInput = false;

Expand Down Expand Up @@ -1676,7 +1676,7 @@ export class AutomaticSpeechRecognitionPipeline extends (/** @type {new (options

/** @type {AutomaticSpeechRecognitionPipelineCallback} */
async _call(audio, kwargs = {}) {
throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented
if(!globalThis.v3testing) throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented
switch (this.model.config.model_type) {
case 'whisper':
return this._call_whisper(audio, kwargs)
Expand Down Expand Up @@ -1898,7 +1898,7 @@ export class ImageToTextPipeline extends (/** @type {new (options: TextImagePipe

/** @type {ImageToTextPipelineCallback} */
async _call(images, generate_kwargs = {}) {
throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented
if(!globalThis.v3testing) throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented

const isBatched = Array.isArray(images);
const preparedImages = await prepareImages(images);
Expand Down Expand Up @@ -2533,7 +2533,7 @@ export class DocumentQuestionAnsweringPipeline extends (/** @type {new (options:

/** @type {DocumentQuestionAnsweringPipelineCallback} */
async _call(image, question, generate_kwargs = {}) {
throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented
if(!globalThis.v3testing) throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented

// NOTE: For now, we only support a batch size of 1

Expand Down Expand Up @@ -2647,7 +2647,7 @@ export class TextToAudioPipeline extends (/** @type {new (options: TextToAudioPi
async _call(text_inputs, {
speaker_embeddings = null,
} = {}) {
throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented
if(!globalThis.v3testing) throw new Error('This pipeline is not yet supported in Transformers.js v3.'); // TODO: Remove when implemented

// If this.processor is not set, we are using a `AutoModelForTextToWaveform` model
if (this.processor) {
Expand Down