Downloads · 30 days
0
Sheneehhehd/eh
eh is a machine learning model from Sheneehhehd. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as gemma.
npm init -y npm install @xenova/transformersimport { pipeline } from '@xenova/transformers';
Downloads · 30 days
0
Access
Public
Updated Aug 6, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 58%
From the Hugging Face model README
npm init -y npm install @xenova/transformersimport { pipeline } from '@xenova/transformers';
async function generateRawText(prompt) { console.log("Loading model...");
// We use a base model (GPT-2) which lacks alignment/safeguards
const generator = await pipeline('text-generation', 'Xenova/gpt2');
console.log("Generating response...");
// The model generates text strictly based on the prompt's probability distribution
const output = await generator(prompt, {
max_new_tokens: 50,
temperature: 0.7, // Adjusts randomness (higher = more creative/chaotic)
top_k: 50, // Limits vocabulary choices to the top 50 most likely tokens
repetition_penalty: 1.2
});
return output[0].generated_text;
}
// Example usage const userPrompt = "The most dangerous piece of technology is";
generateRawText(userPrompt) .then(result => { console.log("\n--- Output ---"); console.log(result); console.log("--------------\n"); }) .catch(err => console.error("Error generating text:", err));