From e440372c99099c53d2efadd69c411f5c92f78efb Mon Sep 17 00:00:00 2001 From: Joshua Lochner Date: Wed, 8 Nov 2023 20:02:38 +0200 Subject: [PATCH] Fix typo in docs (#385) --- src/pipelines.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pipelines.js b/src/pipelines.js index b2b3b19f1..e519df903 100644 --- a/src/pipelines.js +++ b/src/pipelines.js @@ -631,16 +631,16 @@ export class TranslationPipeline extends Text2TextGenerationPipeline { * **Example:** Text generation with `Xenova/distilgpt2` (default settings). * ```javascript * let text = 'I enjoy walking with my cute dog,'; - * let classifier = await pipeline('text-generation', 'Xenova/distilgpt2'); - * let output = await classifier(text); + * let generator = await pipeline('text-generation', 'Xenova/distilgpt2'); + * let output = await generator(text); * // [{ generated_text: "I enjoy walking with my cute dog, and I love to play with the other dogs." }] * ``` * * **Example:** Text generation with `Xenova/distilgpt2` (custom settings). * ```javascript * let text = 'Once upon a time, there was'; - * let classifier = await pipeline('text-generation', 'Xenova/distilgpt2'); - * let output = await classifier(text, { + * let generator = await pipeline('text-generation', 'Xenova/distilgpt2'); + * let output = await generator(text, { * temperature: 2, * max_new_tokens: 10, * repetition_penalty: 1.5, @@ -658,8 +658,8 @@ export class TranslationPipeline extends Text2TextGenerationPipeline { * **Example:** Run code generation with `Xenova/codegen-350M-mono`. * ```javascript * let text = 'def fib(n):'; - * let classifier = await pipeline('text-generation', 'Xenova/codegen-350M-mono'); - * let output = await classifier(text, { + * let generator = await pipeline('text-generation', 'Xenova/codegen-350M-mono'); + * let output = await generator(text, { * max_new_tokens: 44, * }); * // [{