Skip to content

Commit ca9765c

Browse files
committed
Merge branch 'main' into ort-improvements
2 parents 2972828 + 4362237 commit ca9765c

File tree

15 files changed

+294
-275
lines changed

15 files changed

+294
-275
lines changed

README.md

Lines changed: 128 additions & 128 deletions
Large diffs are not rendered by default.

docs/snippets/2_installation.snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ npm i @huggingface/transformers
77
Alternatively, you can use it in vanilla JS, without any bundler, by using a CDN or static hosting. For example, using [ES Modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), you can import the library with:
88
```html
99
<script type="module">
10-
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/[email protected].1';
10+
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/[email protected].2';
1111
</script>
1212
```

docs/snippets/4_custom-usage.snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
By default, Transformers.js uses [hosted pretrained models](https://huggingface.co/models?library=transformers.js) and [precompiled WASM binaries](https://cdn.jsdelivr.net/npm/@huggingface/[email protected].1/dist/), which should work out-of-the-box. You can customize this as follows:
3+
By default, Transformers.js uses [hosted pretrained models](https://huggingface.co/models?library=transformers.js) and [precompiled WASM binaries](https://cdn.jsdelivr.net/npm/@huggingface/[email protected].2/dist/), which should work out-of-the-box. You can customize this as follows:
44

55
### Settings
66

docs/snippets/6_supported-models.snippet

Lines changed: 126 additions & 126 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@huggingface/transformers",
3-
"version": "3.5.1",
3+
"version": "3.5.2",
44
"description": "State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!",
55
"main": "./src/transformers.js",
66
"types": "./types/transformers.d.ts",

src/env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import fs from 'fs';
2626
import path from 'path';
2727
import url from 'url';
2828

29-
const VERSION = '3.5.1';
29+
const VERSION = '3.5.2';
3030

3131
// Check if various APIs are available (depends on environment)
3232
const IS_BROWSER_ENV = typeof window !== "undefined" && typeof window.document !== "undefined";

src/generation/configuration_utils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class GenerationConfig {
7777

7878
/**
7979
* Number of groups to divide `num_beams` into in order to ensure diversity among different groups of beams.
80-
* See [this paper](https://arxiv.org/pdf/1610.02424.pdf) for more details.
80+
* See [this paper](https://huggingface.co/papers/1610.02424) for more details.
8181
* @type {number}
8282
* @default 1
8383
*/
@@ -122,7 +122,7 @@ export class GenerationConfig {
122122
/**
123123
* Local typicality measures how similar the conditional probability of predicting a target token next is to the expected conditional probability of predicting a random token next, given the partial text already generated.
124124
* If set to float < 1, the smallest set of the most locally typical tokens with probabilities that add up to `typical_p` or higher are kept for generation.
125-
* See [this paper](https://arxiv.org/pdf/2202.00666.pdf) for more details.
125+
* See [this paper](https://huggingface.co/papers/2202.00666) for more details.
126126
* @type {number}
127127
* @default 1.0
128128
*/
@@ -131,7 +131,7 @@ export class GenerationConfig {
131131
/**
132132
* If set to float strictly between 0 and 1, only tokens with a conditional probability greater than `epsilon_cutoff` will be sampled.
133133
* In the paper, suggested values range from 3e-4 to 9e-4, depending on the size of the model.
134-
* See [Truncation Sampling as Language Model Desmoothing](https://arxiv.org/abs/2210.15191) for more details.
134+
* See [Truncation Sampling as Language Model Desmoothing](https://huggingface.co/papers/2210.15191) for more details.
135135
* @type {number}
136136
* @default 0.0
137137
*/
@@ -141,7 +141,7 @@ export class GenerationConfig {
141141
* Eta sampling is a hybrid of locally typical sampling and epsilon sampling.
142142
* If set to float strictly between 0 and 1, a token is only considered if it is greater than either `eta_cutoff` or `sqrt(eta_cutoff) * exp(-entropy(softmax(next_token_logits)))`.
143143
* The latter term is intuitively the expected next token probability, scaled by `sqrt(eta_cutoff)`. In the paper, suggested values range from 3e-4 to 2e-3, depending on the size of the model.
144-
* See [Truncation Sampling as Language Model Desmoothing](https://arxiv.org/abs/2210.15191) for more details.
144+
* See [Truncation Sampling as Language Model Desmoothing](https://huggingface.co/papers/2210.15191) for more details.
145145
* @type {number}
146146
* @default 0.0
147147
*/
@@ -157,7 +157,7 @@ export class GenerationConfig {
157157

158158
/**
159159
* The parameter for repetition penalty. 1.0 means no penalty.
160-
* See [this paper](https://arxiv.org/pdf/1909.05858.pdf) for more details.
160+
* See [this paper](https://huggingface.co/papers/1909.05858) for more details.
161161
* @type {number}
162162
* @default 1.0
163163
*/

src/generation/logits_process.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ export class NoRepeatNGramLogitsProcessor extends LogitsProcessor {
410410
* This penalty is applied at most once per token. Note that, for decoder-only models like most LLMs,
411411
* the considered tokens include the prompt.
412412
*
413-
* In the original [paper](https://arxiv.org/pdf/1909.05858.pdf), the authors suggest the use of a
413+
* In the original [paper](https://huggingface.co/papers/1909.05858), the authors suggest the use of a
414414
* penalty of around 1.2 to achieve a good balance between truthful generation and lack of repetition.
415415
* To penalize and reduce repetition, use `penalty` values above 1.0, where a higher value penalizes
416416
* more strongly. To reward and encourage repetition, use `penalty` values between 0.0 and 1.0, where
@@ -580,7 +580,7 @@ export class NoBadWordsLogitsProcessor extends LogitsProcessor {
580580
* correspond to the unconditional logits (predicted from an empty or 'null' prompt). The processor computes a
581581
* weighted average across the conditional and unconditional logits, parameterised by the `guidance_scale`.
582582
*
583-
* See [the paper](https://arxiv.org/abs/2306.05284) for more information.
583+
* See [the paper](https://huggingface.co/papers/2306.05284) for more information.
584584
*/
585585
export class ClassifierFreeGuidanceLogitsProcessor extends LogitsProcessor {
586586

src/generation/streamers.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,11 @@ export class WhisperTextStreamer extends TextStreamer {
208208
this.on_chunk_start?.(time);
209209
}
210210
this.waiting_for_timestamp = !this.waiting_for_timestamp; // Toggle
211-
value = [[]]; // Skip timestamp
211+
212+
// NOTE: Timestamp tokens should not be printed. Although, since they
213+
// aren't classified as "special tokens", we need to handle them here.
214+
this.token_callback_function?.(tokens);
215+
return;
212216
}
213217
}
214218
return super.put(value);

0 commit comments

Comments
 (0)