transformers.js/docs/snippets/2_installation.snippet

13 lines
491 B
Plaintext
Raw Normal View History

2023-05-14 01:59:18 +08:00
To install via [NPM](https://www.npmjs.com/package/@xenova/transformers), run:
```bash
npm i @xenova/transformers
```
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:
```html
<script type="module">
2024-05-29 22:22:05 +08:00
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers@2.17.2';
2023-05-14 01:59:18 +08:00
</script>
```