How to use?
#1
by jdp8 - opened
Hello,
I tried to use this model like so:
import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@4.0.0-next.2";
const generator = await pipeline(
"text-generation",
"onnx-community/gpt-oss-20b-ONNX",
{
dtype: "q4f16",
device: "webgpu"
},
);
const messages = [
{
role: "user",
content: "Who are you?",
}
];
const output = await generator(messages);
console.log(output[0].generated_text.at(-1).content);
But I almost always get a blank response or a weird output. Am I missing something in order to run this model?
Any assistance will be appreciated!
transformers.js publish an example:
https://huggingface.co/spaces/webml-community/GPT-OSS-WebGPU/tree/main
jdp8 changed discussion status to closed