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
Willkommen!
Teilen und diskutieren Sie die besten Inhalte und neuen Marketingideen, bauen Sie Ihr professionelles Profil auf und werden Sie gemeinsam ein besserer Vermarkter.
This question has been flagged
const axios = require("axios");
const HF_TOKEN = "hf_..."; // Dein Token
async function testTextGeneration() {
try {
console.log("Teste Text-Generierung API...");
const response = await axios.post(
"https://api-inference.huggingface.co/pipeline/text-generation/gpt2",
{ inputs: "Hallo, wie geht es dir?" },
{
headers: {
"Authorization": `Bearer ${HF_TOKEN}`
}
}
);
console.log("Erfolg:", response.data);
} catch (error) {
console.error("Fehler:", error.message);
if (error.response) {
console.error("Status:", error.response.status);
console.error("Daten:", JSON.stringify(error.response.data));
}
}
}
testTextGeneration();
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|
|
0
Dec 25
|
341 |