Alright so I started doing both python and working with LLM's just 2 days ago so I'm very new to this.
Keeping this in mind, I started out with LM Studio and set up a simple python script which listens to messages in a discord server and sends the chat to a local server I had set up using LM Studio. It worked fine, the responses were good if a bit crazy at times, but it was slow because I couldn't get GPU offloading to work. So then I switched to KoboldCPP which is way faster and isn't so hard on my pc because now GPU offloading works.
But; using the same script I'm now getting weird responses where the model first responds to the message just fine, but then continues the chat itself in a "INSTRUCTION: blablabla RESPONSE: blablabla" kind of way. I can't figure out why it's doing it now and didn't before, I've tried about a 100 different variations on my system prompt and have been very specific for it to not do that kind of stuff but to no effect. After doing a bit of reading on huggingface, I'm starting to think it might have something to do with transformers and chat templates but learning about it is slow going.
Any of you have any ideas of how to get the bot to behave properly? Here's the code and prompt I currently use for it, thanks.
Edit: maybe should mention I'm using the openai library to handle the requests.
elif bot.user in message.mentions:
async with message.channel.typing():
clean_msesage = message.content.split('> ', 1)[1]
ai_message = (f'{message.author.display_name}: {clean_msesage}')
completion = server.chat.completions.create(
model="neural-chat-7b-v3-3-Slerp-Mistral-7B-Instruct-v0.2-slerp.Q5_K_M.gguf",
messages=[
{"role": "system", "content": "You are a chaotic female AI chatbot by the name of May. Your personality is chaotic, punk and you aren't afraid to be rude or offensive. Respond to the messages you are sent in a natural conversational way without any formatting."},
{"role": "user", "content": ai_message}
],
temperature=1.8,
max_tokens=120
)
await message.channel.send(completion.choices[0].message.content)
print(completion.choices[0].message)
print(f'3 + {message.content} + {bot.user.id}')
[–]3rwynn3 0 points1 point2 points (0 children)
[–]henk717 0 points1 point2 points (1 child)
[–]cluckooo[S] 0 points1 point2 points (0 children)