Skip to content

Commit 19a6e03

Browse files
authored
Merge pull request #2 from huggingface/main
merged latest
2 parents ab41df3 + 1538e3a commit 19a6e03

File tree

10 files changed

+26
-8
lines changed

10 files changed

+26
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ node_modules
44
.cache
55
.DS_STORE
66
deno.lock
7+
.idea
78

89
# Do not track build artifacts/generated files
910
/dist

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ npm i @huggingface/transformers
4747
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:
4848
```html
4949
<script type="module">
50-
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.4';
50+
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5';
5151
</script>
5252
```
5353

@@ -155,7 +155,7 @@ Check out the Transformers.js [template](https://huggingface.co/new-space?templa
155155

156156

157157

158-
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/transformers@3.7.4/dist/), which should work out-of-the-box. You can customize this as follows:
158+
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/transformers@3.7.5/dist/), which should work out-of-the-box. You can customize this as follows:
159159

160160
### Settings
161161

@@ -344,6 +344,7 @@ You can refine your search by selecting the task you're interested in (e.g., [te
344344
1. **[GPT-J](https://huggingface.co/docs/transformers/model_doc/gptj)** (from EleutherAI) released in the repository [kingoflolz/mesh-transformer-jax](https://github.com/kingoflolz/mesh-transformer-jax/) by Ben Wang and Aran Komatsuzaki.
345345
1. **[GPTBigCode](https://huggingface.co/docs/transformers/model_doc/gpt_bigcode)** (from BigCode) released with the paper [SantaCoder: don't reach for the stars!](https://huggingface.co/papers/2301.03988) by Loubna Ben Allal, Raymond Li, Denis Kocetkov, Chenghao Mou, Christopher Akiki, Carlos Munoz Ferrandis, Niklas Muennighoff, Mayank Mishra, Alex Gu, Manan Dey, Logesh Kumar Umapathi, Carolyn Jane Anderson, Yangtian Zi, Joel Lamy Poirier, Hailey Schoelkopf, Sergey Troshin, Dmitry Abulkhanov, Manuel Romero, Michael Lappert, Francesco De Toni, Bernardo García del Río, Qian Liu, Shamik Bose, Urvashi Bhattacharyya, Terry Yue Zhuo, Ian Yu, Paulo Villegas, Marco Zocca, Sourab Mangrulkar, David Lansky, Huu Nguyen, Danish Contractor, Luis Villa, Jia Li, Dzmitry Bahdanau, Yacine Jernite, Sean Hughes, Daniel Fried, Arjun Guha, Harm de Vries, Leandro von Werra.
346346
1. **[Granite](https://huggingface.co/docs/transformers/main/model_doc/granite)** (from IBM) released with the paper [Power Scheduler: A Batch Size and Token Number Agnostic Learning Rate Scheduler](https://huggingface.co/papers/2408.13359) by Yikang Shen, Matthew Stallone, Mayank Mishra, Gaoyuan Zhang, Shawn Tan, Aditya Prasad, Adriana Meza Soria, David D. Cox, Rameswar Panda.
347+
1. **[GraniteMoeHybrid](https://huggingface.co/docs/transformers/main/model_doc/granitemoehybrid)** (from IBM) released with the blog post [IBM Granite 4.0: hyper-efficient, high performance hybrid models for enterprise](https://www.ibm.com/new/announcements/ibm-granite-4-0-hyper-efficient-high-performance-hybrid-models) by the IBM Granite team.
347348
1. **[Grounding DINO](https://huggingface.co/docs/transformers/model_doc/grounding-dino)** (from IDEA-Research) released with the paper [Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detection](https://huggingface.co/papers/2303.05499) by Shilong Liu, Zhaoyang Zeng, Tianhe Ren, Feng Li, Hao Zhang, Jie Yang, Qing Jiang, Chunyuan Li, Jianwei Yang, Hang Su, Jun Zhu, Lei Zhang.
348349
1. **[GroupViT](https://huggingface.co/docs/transformers/model_doc/groupvit)** (from UCSD, NVIDIA) released with the paper [GroupViT: Semantic Segmentation Emerges from Text Supervision](https://huggingface.co/papers/2202.11094) by Jiarui Xu, Shalini De Mello, Sifei Liu, Wonmin Byeon, Thomas Breuel, Jan Kautz, Xiaolong Wang.
349350
1. **[Helium](https://huggingface.co/docs/transformers/main/model_doc/helium)** (from the Kyutai Team) released with the blog post [Announcing Helium-1 Preview](https://kyutai.org/2025/01/13/helium.html) by the Kyutai Team.

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/transformers@3.7.4';
10+
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.7.5';
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/transformers@3.7.4/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/transformers@3.7.5/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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
1. **[GPT-J](https://huggingface.co/docs/transformers/model_doc/gptj)** (from EleutherAI) released in the repository [kingoflolz/mesh-transformer-jax](https://github.com/kingoflolz/mesh-transformer-jax/) by Ben Wang and Aran Komatsuzaki.
5959
1. **[GPTBigCode](https://huggingface.co/docs/transformers/model_doc/gpt_bigcode)** (from BigCode) released with the paper [SantaCoder: don't reach for the stars!](https://huggingface.co/papers/2301.03988) by Loubna Ben Allal, Raymond Li, Denis Kocetkov, Chenghao Mou, Christopher Akiki, Carlos Munoz Ferrandis, Niklas Muennighoff, Mayank Mishra, Alex Gu, Manan Dey, Logesh Kumar Umapathi, Carolyn Jane Anderson, Yangtian Zi, Joel Lamy Poirier, Hailey Schoelkopf, Sergey Troshin, Dmitry Abulkhanov, Manuel Romero, Michael Lappert, Francesco De Toni, Bernardo García del Río, Qian Liu, Shamik Bose, Urvashi Bhattacharyya, Terry Yue Zhuo, Ian Yu, Paulo Villegas, Marco Zocca, Sourab Mangrulkar, David Lansky, Huu Nguyen, Danish Contractor, Luis Villa, Jia Li, Dzmitry Bahdanau, Yacine Jernite, Sean Hughes, Daniel Fried, Arjun Guha, Harm de Vries, Leandro von Werra.
6060
1. **[Granite](https://huggingface.co/docs/transformers/main/model_doc/granite)** (from IBM) released with the paper [Power Scheduler: A Batch Size and Token Number Agnostic Learning Rate Scheduler](https://huggingface.co/papers/2408.13359) by Yikang Shen, Matthew Stallone, Mayank Mishra, Gaoyuan Zhang, Shawn Tan, Aditya Prasad, Adriana Meza Soria, David D. Cox, Rameswar Panda.
61+
1. **[GraniteMoeHybrid](https://huggingface.co/docs/transformers/main/model_doc/granitemoehybrid)** (from IBM) released with the blog post [IBM Granite 4.0: hyper-efficient, high performance hybrid models for enterprise](https://www.ibm.com/new/announcements/ibm-granite-4-0-hyper-efficient-high-performance-hybrid-models) by the IBM Granite team.
6162
1. **[Grounding DINO](https://huggingface.co/docs/transformers/model_doc/grounding-dino)** (from IDEA-Research) released with the paper [Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detection](https://huggingface.co/papers/2303.05499) by Shilong Liu, Zhaoyang Zeng, Tianhe Ren, Feng Li, Hao Zhang, Jie Yang, Qing Jiang, Chunyuan Li, Jianwei Yang, Hang Su, Jun Zhu, Lei Zhang.
6263
1. **[GroupViT](https://huggingface.co/docs/transformers/model_doc/groupvit)** (from UCSD, NVIDIA) released with the paper [GroupViT: Semantic Segmentation Emerges from Text Supervision](https://huggingface.co/papers/2202.11094) by Jiarui Xu, Shalini De Mello, Sifei Liu, Wonmin Byeon, Thomas Breuel, Jan Kautz, Xiaolong Wang.
6364
1. **[Helium](https://huggingface.co/docs/transformers/main/model_doc/helium)** (from the Kyutai Team) released with the blog post [Announcing Helium-1 Preview](https://kyutai.org/2025/01/13/helium.html) by the Kyutai Team.

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.7.4",
3+
"version": "3.7.5",
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/configs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ function getNormalizedConfig(config) {
119119
case 'olmo2':
120120
case 'mobilellm':
121121
case 'granite':
122+
case 'granitemoehybrid':
122123
case 'cohere':
123124
case 'mistral':
124125
case 'starcoder2':

src/env.js

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

29-
const VERSION = '3.7.4';
29+
const VERSION = '3.7.5';
3030

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

src/models.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,12 @@ export class PreTrainedModel extends Callable {
14271427
processors.push(new ClassifierFreeGuidanceLogitsProcessor(generation_config.guidance_scale));
14281428
}
14291429

1430+
1431+
if (generation_config.temperature === 0 && generation_config.do_sample) {
1432+
console.warn('`do_sample` changed to false because `temperature: 0` implies greedy sampling (always selecting the most likely token), which is incompatible with `do_sample: true`.');
1433+
generation_config.do_sample = false;
1434+
}
1435+
14301436
if (generation_config.do_sample) {
14311437
if (generation_config.temperature !== null && generation_config.temperature !== 1.0) {
14321438
processors.push(new TemperatureLogitsWarper(generation_config.temperature));
@@ -4653,6 +4659,12 @@ export class GraniteModel extends GranitePreTrainedModel { }
46534659
export class GraniteForCausalLM extends GranitePreTrainedModel { }
46544660
//////////////////////////////////////////////////
46554661

4662+
//////////////////////////////////////////////////
4663+
// GraniteMoeHybrid models
4664+
export class GraniteMoeHybridPreTrainedModel extends PreTrainedModel { }
4665+
export class GraniteMoeHybridModel extends GraniteMoeHybridPreTrainedModel { }
4666+
export class GraniteMoeHybridForCausalLM extends GraniteMoeHybridPreTrainedModel { }
4667+
//////////////////////////////////////////////////
46564668

46574669
//////////////////////////////////////////////////
46584670
// Cohere models
@@ -7841,6 +7853,7 @@ const MODEL_MAPPING_NAMES_DECODER_ONLY = new Map([
78417853
['olmo2', ['Olmo2Model', Olmo2Model]],
78427854
['mobilellm', ['MobileLLMModel', MobileLLMModel]],
78437855
['granite', ['GraniteModel', GraniteModel]],
7856+
['granitemoehybrid', ['GraniteMoeHybridModel', GraniteMoeHybridModel]],
78447857
['cohere', ['CohereModel', CohereModel]],
78457858
['gemma', ['GemmaModel', GemmaModel]],
78467859
['gemma2', ['Gemma2Model', Gemma2Model]],
@@ -7951,6 +7964,7 @@ const MODEL_FOR_CAUSAL_LM_MAPPING_NAMES = new Map([
79517964
['olmo2', ['Olmo2ForCausalLM', Olmo2ForCausalLM]],
79527965
['mobilellm', ['MobileLLMForCausalLM', MobileLLMForCausalLM]],
79537966
['granite', ['GraniteForCausalLM', GraniteForCausalLM]],
7967+
['granitemoehybrid', ['GraniteMoeHybridForCausalLM', GraniteMoeHybridForCausalLM]],
79547968
['cohere', ['CohereForCausalLM', CohereForCausalLM]],
79557969
['gemma', ['GemmaForCausalLM', GemmaForCausalLM]],
79567970
['gemma2', ['Gemma2ForCausalLM', Gemma2ForCausalLM]],

0 commit comments

Comments
 (0)