Usage (Transformers.js)

If you haven't already, you can install the Transformers.js JavaScript library from NPM using:

npm i @huggingface/transformers

You can then generate text as follows:

import { pipeline } from '@huggingface/transformers';

// Create a text generation pipeline
const generator = await pipeline('text-generation', 'eduardoworrel/SmolLM2-135M', {
  device: 'auto', 
});

// Generate a response
const output = await generator("Qual a captial do Brasil?", { max_new_tokens: 128 });
console.log(output[0].generated_text.at(-1).content);
Downloads last month
3
Inference Providers NEW
This model is not currently available via any of the supported third-party Inference Providers, and the HF Inference API does not support transformers.js models with pipeline type text-generation

Model tree for eduardoworrel/SmolLM2-135M

Quantized
(25)
this model