@huggingface/transformers 3.0.0-alpha.11 → 3.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/transformers.cjs +37 -1
- package/dist/transformers.cjs.map +1 -1
- package/dist/transformers.js +41 -2
- package/dist/transformers.js.map +1 -1
- package/dist/transformers.min.cjs +7 -7
- package/dist/transformers.min.cjs.map +1 -1
- package/dist/transformers.min.js +13 -13
- package/dist/transformers.min.js.map +1 -1
- package/dist/transformers.min.mjs +167 -0
- package/dist/transformers.min.mjs.map +1 -0
- package/dist/transformers.mjs +31389 -0
- package/dist/transformers.mjs.map +1 -0
- package/package.json +2 -2
- package/src/configs.js +1 -0
- package/src/env.js +1 -1
- package/src/models.js +29 -0
- package/types/configs.d.ts.map +1 -1
- package/types/models.d.ts +20 -0
- package/types/models.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ npm i @huggingface/transformers
|
|
|
101
101
|
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:
|
|
102
102
|
```html
|
|
103
103
|
<script type="module">
|
|
104
|
-
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.0.0-alpha.
|
|
104
|
+
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.0.0-alpha.12';
|
|
105
105
|
</script>
|
|
106
106
|
```
|
|
107
107
|
|
|
@@ -134,7 +134,7 @@ Check out the Transformers.js [template](https://huggingface.co/new-space?templa
|
|
|
134
134
|
|
|
135
135
|
|
|
136
136
|
|
|
137
|
-
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.0.0-alpha.
|
|
137
|
+
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.0.0-alpha.12/dist/), which should work out-of-the-box. You can customize this as follows:
|
|
138
138
|
|
|
139
139
|
### Settings
|
|
140
140
|
|
|
@@ -311,6 +311,7 @@ You can refine your search by selecting the task you're interested in (e.g., [te
|
|
|
311
311
|
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://arxiv.org/abs/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.
|
|
312
312
|
1. **[HerBERT](https://huggingface.co/docs/transformers/model_doc/herbert)** (from Allegro.pl, AGH University of Science and Technology) released with the paper [KLEJ: Comprehensive Benchmark for Polish Language Understanding](https://www.aclweb.org/anthology/2020.acl-main.111.pdf) by Piotr Rybak, Robert Mroczkowski, Janusz Tracz, Ireneusz Gawlik.
|
|
313
313
|
1. **[Hubert](https://huggingface.co/docs/transformers/model_doc/hubert)** (from Facebook) released with the paper [HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden Units](https://arxiv.org/abs/2106.07447) by Wei-Ning Hsu, Benjamin Bolte, Yao-Hung Hubert Tsai, Kushal Lakhotia, Ruslan Salakhutdinov, Abdelrahman Mohamed.
|
|
314
|
+
1. **JAIS** (from Core42) released with the paper [Jais and Jais-chat: Arabic-Centric Foundation and Instruction-Tuned Open Generative Large Language Models](https://arxiv.org/pdf/2308.16149) by Neha Sengupta, Sunil Kumar Sahu, Bokang Jia, Satheesh Katipomu, Haonan Li, Fajri Koto, William Marshall, Gurpreet Gosal, Cynthia Liu, Zhiming Chen, Osama Mohammed Afzal, Samta Kamboj, Onkar Pandit, Rahul Pal, Lalit Pradhan, Zain Muhammad Mujahid, Massa Baali, Xudong Han, Sondos Mahmoud Bsharat, Alham Fikri Aji, Zhiqiang Shen, Zhengzhong Liu, Natalia Vassilieva, Joel Hestness, Andy Hock, Andrew Feldman, Jonathan Lee, Andrew Jackson, Hector Xuguang Ren, Preslav Nakov, Timothy Baldwin, Eric Xing.
|
|
314
315
|
1. **[LongT5](https://huggingface.co/docs/transformers/model_doc/longt5)** (from Google AI) released with the paper [LongT5: Efficient Text-To-Text Transformer for Long Sequences](https://arxiv.org/abs/2112.07916) by Mandy Guo, Joshua Ainslie, David Uthus, Santiago Ontanon, Jianmo Ni, Yun-Hsuan Sung, Yinfei Yang.
|
|
315
316
|
1. **[LLaMA](https://huggingface.co/docs/transformers/model_doc/llama)** (from The FAIR team of Meta AI) released with the paper [LLaMA: Open and Efficient Foundation Language Models](https://arxiv.org/abs/2302.13971) by Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin, Edouard Grave, Guillaume Lample.
|
|
316
317
|
1. **[Llama2](https://huggingface.co/docs/transformers/model_doc/llama2)** (from The FAIR team of Meta AI) released with the paper [Llama2: Open Foundation and Fine-Tuned Chat Models](https://ai.meta.com/research/publications/llama-2-open-foundation-and-fine-tuned-chat-models/XXX) by Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, Dan Bikel, Lukas Blecher, Cristian Canton Ferrer, Moya Chen, Guillem Cucurull, David Esiobu, Jude Fernandes, Jeremy Fu, Wenyin Fu, Brian Fuller, Cynthia Gao, Vedanuj Goswami, Naman Goyal, Anthony Hartshorn, Saghar Hosseini, Rui Hou, Hakan Inan, Marcin Kardas, Viktor Kerkez Madian Khabsa, Isabel Kloumann, Artem Korenev, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Jenya Lee, Diana Liskovich, Yinghai Lu, Yuning Mao, Xavier Martinet, Todor Mihaylov, Pushka rMishra, Igor Molybog, Yixin Nie, Andrew Poulton, Jeremy Reizenstein, Rashi Rungta, Kalyan Saladi, Alan Schelten, Ruan Silva, Eric Michael Smith, Ranjan Subramanian, Xiaoqing EllenTan, Binh Tang, Ross Taylor, Adina Williams, Jian Xiang Kuan, Puxin Xu, Zheng Yan, Iliyan Zarov, Yuchen Zhang, Angela Fan, Melanie Kambadur, Sharan Narang, Aurelien Rodriguez, Robert Stojnic, Sergey Edunov, Thomas Scialom.
|
package/dist/transformers.cjs
CHANGED
|
@@ -4104,6 +4104,7 @@ function getNormalizedConfig(config) {
|
|
|
4104
4104
|
// Decoder-only models
|
|
4105
4105
|
case 'gpt2':
|
|
4106
4106
|
case 'gptj':
|
|
4107
|
+
case 'jais':
|
|
4107
4108
|
case 'codegen':
|
|
4108
4109
|
case 'gpt_bigcode':
|
|
4109
4110
|
mapping['num_heads'] = 'n_head';
|
|
@@ -4436,7 +4437,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4436
4437
|
|
|
4437
4438
|
|
|
4438
4439
|
|
|
4439
|
-
const VERSION = '3.0.0-alpha.
|
|
4440
|
+
const VERSION = '3.0.0-alpha.12';
|
|
4440
4441
|
|
|
4441
4442
|
// Check if various APIs are available (depends on environment)
|
|
4442
4443
|
const IS_BROWSER_ENV = typeof self !== 'undefined';
|
|
@@ -6533,6 +6534,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6533
6534
|
/* harmony export */ HubertModel: () => (/* binding */ HubertModel),
|
|
6534
6535
|
/* harmony export */ HubertPreTrainedModel: () => (/* binding */ HubertPreTrainedModel),
|
|
6535
6536
|
/* harmony export */ ImageMattingOutput: () => (/* binding */ ImageMattingOutput),
|
|
6537
|
+
/* harmony export */ JAISLMHeadModel: () => (/* binding */ JAISLMHeadModel),
|
|
6538
|
+
/* harmony export */ JAISModel: () => (/* binding */ JAISModel),
|
|
6539
|
+
/* harmony export */ JAISPreTrainedModel: () => (/* binding */ JAISPreTrainedModel),
|
|
6536
6540
|
/* harmony export */ LlamaForCausalLM: () => (/* binding */ LlamaForCausalLM),
|
|
6537
6541
|
/* harmony export */ LlamaModel: () => (/* binding */ LlamaModel),
|
|
6538
6542
|
/* harmony export */ LlamaPreTrainedModel: () => (/* binding */ LlamaPreTrainedModel),
|
|
@@ -10500,6 +10504,33 @@ class GPT2LMHeadModel extends GPT2PreTrainedModel { }
|
|
|
10500
10504
|
// }
|
|
10501
10505
|
//////////////////////////////////////////////////
|
|
10502
10506
|
|
|
10507
|
+
//////////////////////////////////////////////////
|
|
10508
|
+
// JAIS models
|
|
10509
|
+
class JAISPreTrainedModel extends PreTrainedModel {
|
|
10510
|
+
/**
|
|
10511
|
+
* Creates a new instance of the `JAISPreTrainedModel` class.
|
|
10512
|
+
* @param {Object} config The model configuration.
|
|
10513
|
+
* @param {Record<string, any>} sessions The inference sessions for the model.
|
|
10514
|
+
* @param {GenerationConfig} generation_config The generation configuration.
|
|
10515
|
+
*/
|
|
10516
|
+
constructor(config, sessions, generation_config) {
|
|
10517
|
+
super(config, sessions);
|
|
10518
|
+
this.generation_config = generation_config;
|
|
10519
|
+
}
|
|
10520
|
+
}
|
|
10521
|
+
|
|
10522
|
+
/**
|
|
10523
|
+
* The bare JAIS Model transformer outputting raw hidden-states without any specific head on top.
|
|
10524
|
+
*/
|
|
10525
|
+
class JAISModel extends JAISPreTrainedModel { }
|
|
10526
|
+
|
|
10527
|
+
/**
|
|
10528
|
+
* The JAIS Model transformer with a language modeling head on top (linear layer with weights tied to the input embeddings).
|
|
10529
|
+
*/
|
|
10530
|
+
class JAISLMHeadModel extends JAISPreTrainedModel { }
|
|
10531
|
+
//////////////////////////////////////////////////
|
|
10532
|
+
|
|
10533
|
+
|
|
10503
10534
|
//////////////////////////////////////////////////
|
|
10504
10535
|
// GPTNeo models
|
|
10505
10536
|
class GPTNeoPreTrainedModel extends PreTrainedModel {
|
|
@@ -13062,6 +13093,7 @@ const MODEL_MAPPING_NAMES_ENCODER_DECODER = new Map([
|
|
|
13062
13093
|
|
|
13063
13094
|
const MODEL_MAPPING_NAMES_DECODER_ONLY = new Map([
|
|
13064
13095
|
['bloom', ['BloomModel', BloomModel]],
|
|
13096
|
+
['jais', ['JAISModel', JAISModel]],
|
|
13065
13097
|
['gpt2', ['GPT2Model', GPT2Model]],
|
|
13066
13098
|
['gptj', ['GPTJModel', GPTJModel]],
|
|
13067
13099
|
['gpt_bigcode', ['GPTBigCodeModel', GPTBigCodeModel]],
|
|
@@ -13150,6 +13182,7 @@ const MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING_NAMES = new Map([
|
|
|
13150
13182
|
const MODEL_FOR_CAUSAL_LM_MAPPING_NAMES = new Map([
|
|
13151
13183
|
['bloom', ['BloomForCausalLM', BloomForCausalLM]],
|
|
13152
13184
|
['gpt2', ['GPT2LMHeadModel', GPT2LMHeadModel]],
|
|
13185
|
+
['jais', ['JAISLMHeadModel', JAISLMHeadModel]],
|
|
13153
13186
|
['gptj', ['GPTJForCausalLM', GPTJForCausalLM]],
|
|
13154
13187
|
['gpt_bigcode', ['GPTBigCodeForCausalLM', GPTBigCodeForCausalLM]],
|
|
13155
13188
|
['gpt_neo', ['GPTNeoForCausalLM', GPTNeoForCausalLM]],
|
|
@@ -30442,6 +30475,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30442
30475
|
/* harmony export */ ImageToImagePipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_1__.ImageToImagePipeline),
|
|
30443
30476
|
/* harmony export */ ImageToTextPipeline: () => (/* reexport safe */ _pipelines_js__WEBPACK_IMPORTED_MODULE_1__.ImageToTextPipeline),
|
|
30444
30477
|
/* harmony export */ InterruptableStoppingCriteria: () => (/* reexport safe */ _generation_stopping_criteria_js__WEBPACK_IMPORTED_MODULE_11__.InterruptableStoppingCriteria),
|
|
30478
|
+
/* harmony export */ JAISLMHeadModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.JAISLMHeadModel),
|
|
30479
|
+
/* harmony export */ JAISModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.JAISModel),
|
|
30480
|
+
/* harmony export */ JAISPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.JAISPreTrainedModel),
|
|
30445
30481
|
/* harmony export */ LlamaForCausalLM: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LlamaForCausalLM),
|
|
30446
30482
|
/* harmony export */ LlamaModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LlamaModel),
|
|
30447
30483
|
/* harmony export */ LlamaPreTrainedModel: () => (/* reexport safe */ _models_js__WEBPACK_IMPORTED_MODULE_2__.LlamaPreTrainedModel),
|