Skip to main content
Deno 2 is finally here 🎉️
Learn more

huggingface deno

Huggingface api for deno

Usage

import { Inference } from "https://deno.land/x/huggingface/mod.ts";

const model = new Inference({
  model: "EleutherAI/gpt-neo-2.7B",
  token: Deno.env.get("HUGGINGFACE_TOKEN")!,
});

const output = await model.run("The meaning of life is");

console.log(output[0].generated_text);

Maintainers

Contribution

Pull request, issues and feedback are very welcome. Code style is formatted with deno fmt and commit messages are done following Conventional Commits spec.

Licence

Copyright 2023, Dean Srebnik. All rights reserved. MIT license.