hf-code-llama-infiller
v0.0.1
Published
Code infilling with Hugging Face Code Llama 🦙
Downloads
1
Readme
Hugging Face Code Llama Infiller 🦙
This library allows you to infill (fill-in-the-middle) code with Code Llama hosted on Hugging Face Inference Endpoints platform.
How to use
- Install the library
npm install hf-code-llama-infiller
- Use the library
import { HfCodeLlamaInfiller } from "hf-code-llama-infiller";
const infiller = new HfCodeLlamaInfiller({
hfEndpoint: "<your hugging face endpoint>",
hfAccessToken: "<your hugging face access token>",
modelId: "codellama/CodeLlama-7b-hf",
promptBuilderId: "naive-asymmetrical",
resultEmbedderId: "prevent-overfilling",
});
infiller
.infill(
"def get_sum(a, b)", // Prefix
"\n", // Suffix
512 // Max context size
)
.then(console.log); // Full infilled result