#πŸ”’ Hugging face AIs saying gibberish

36 messages Β· Page 1 of 1 (latest)

bleak panther
#

I'm making a discord bot and I want a chat with AI, I don't need a crazy AI that can like solve maths or program for me, just an AI that you can have somewhat of a conversation with. I looked at some free options and tried a bunch of models from hugging face: gpt-neo, gpt-2, DialoGPT, BERT (tried GPT-J but it seems to require too much memory (24GB) to be free) and got absolute non-sense responses, from each of these AIs, the best of them was probably DialoGPT with:
Hello?
Hello? from outer barrel eh?
It could at least maybe say something funny, but nothing that makes sense.

This is my code, maybe I am doing something wrong. If I am not, I'd love to know if there's any free API for what I want.

from discord.ext import commands
import discord

from bot import PDBot
from constants import AI_CHAT_CHANNEL_ID

class AIChat(commands.Cog):
    def __init__(self, bot: PDBot):
        self.bot: PDBot = bot
        self.api_url: str = "https://api-inference.huggingface.co/models/microsoft/DialoGPT-medium"

    @commands.Cog.listener()
    async def on_message(self, message: discord.Message):
        if message.channel.id == AI_CHAT_CHANNEL_ID and not message.author.bot:
            payload = {"inputs": message.content}
            response = await self.bot.session.post(self.api_url, headers={"Authorization": f"Bearer {self.bot.config.huggingface_token}"}, json=payload)
            if response.status == 200:
                data = await response.json()
                await message.reply(data[0]['generated_text'])
            else:
                response_content = await response.text()
                response_headers = dict(response.headers)
                print(f"Response Status Code: {response.status}")
                print(f"Response Content: {response_content}")
                print(f"Response Headers: {response_headers}")
                await message.reply("Sorry, I couldn't fetch a response.")

async def setup(bot):
    await bot.add_cog(AIChat(bot))
rough merlinBOT
#

@bleak panther

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

stoic scaffold
#

if its a private bot, why dont you use gpt3?

bleak panther
#

especially not to the closed ai company

stoic scaffold
#

gpt3 api is free

#

wdym?

bleak panther
#

actually?

stoic scaffold
#

yeah

#

just use that api

bleak panther
stoic scaffold
#

link what? you still need the api key from your account lol

bleak panther
#

I don't even have a ClosedAI account because I'm Russian

stoic scaffold
#

ok so

#

you dont need to pay moneey to appen an account

bleak panther
#

I don't think they would have a free API

#

no shot

stoic scaffold
#

tbh i had a project useing chatgpt

#

but i dont remember if I used an API or just scraped it lol

#

Ok so they changed it

#

you get 5 dollars of free credit which is 750 calls approx. when you sign up with a phone number

#

it turns out i have used gpt3 which is out-of-support now

#

Idk i use claude πŸ’€

bleak panther
bleak panther
stoic scaffold
#

look into gemini maybe?

bleak panther
#

this is a side side project

#

I was just hoping there could be some free thingy

#

but ig I'm stuck with the outer barrel eh

stoic scaffold
#

yeah its free

rough merlinBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.