My bot was working just fine with no errors this morning and I haven’t changed any of the code. It suddenly just started printing this error. I have no local saved files and its linking back to my huggingface page just fine. No files are changed. I am so frustrated trying to figure out what’s wrong. Does anyone know what is causing this???
Heres a snippit of my code where I think it is relevant:
API_URL = 'https://api-inference.huggingface.co/models/Karissycloud/Cloudbot';
const db = new Database();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('messageCreate', async message => {
if (message.author.bot) {
return;
}
message.channel.sendTyping();
db.set(message.author.id, message.content).then(() => {
console.log("Value set successfully!");
});
const previousMessage = await db.get(message.author.id);
const payload = {
inputs: {
text: previousMessage ? previousMessage + " " + message.content : message.content
}
};
const response = await fetch(API_URL, {
headers: { Authorization: "Bearer ***************************" },
method: "POST",
body: JSON.stringify(payload),
});
const data = await response.json();
let botResponse = '';
if (data.hasOwnProperty('generated_text')) {
botResponse = data.generated_text;
} else if (data.hasOwnProperty('error')) {
botResponse = data.error;
Please, any help is apricated.