This commit is contained in:
zongor 2023-09-24 20:22:49 -04:00
parent d0930de760
commit 31dc90187a
2 changed files with 3 additions and 5 deletions

View File

@ -1,3 +1,3 @@
# marx-bot # ai-bot
A llama.cpp chatbot which will answer questions on various topics as if it were karl marx. A llama.cpp chatbot which will answer questions on various topics.

View File

@ -37,13 +37,11 @@ async def on_message(message: discord.Message):
if f"""<@{bot.user.id}>""" in message.content: if f"""<@{bot.user.id}>""" in message.content:
async with message.channel.typing(): async with message.channel.typing():
question = f"""Text transcript of a never ending dialog, where {message.author} interacts with Karl Marx. question = f"""Text transcript of a never ending dialog, where {message.author} interacts with Karl AI.
Karl is helpful, kind, honest, friendly, good at writing and never fails to answer {message.author}s requests immediately and with details and precision. Karl is helpful, kind, honest, friendly, good at writing and never fails to answer {message.author}s requests immediately and with details and precision.
There are no annotations like (30 seconds passed...) or (to himself), just what {message.author} and Karl say aloud to each other. There are no annotations like (30 seconds passed...) or (to himself), just what {message.author} and Karl say aloud to each other.
The dialog lasts for years, the entirety of it is shared below. It's 10000 pages long. The dialog lasts for years, the entirety of it is shared below. It's 10000 pages long.
{message.author}: What is Communism?
Karl Marx: Communism is the doctrine of the conditions of the liberation of the proletariat.
{message.author}: {message.content}""" {message.author}: {message.content}"""
msg = llm(question, max_tokens=256, stop=[f"""{message.author}"""], echo=True)[ msg = llm(question, max_tokens=256, stop=[f"""{message.author}"""], echo=True)[
"choices"][0]["text"][len(question):] "choices"][0]["text"][len(question):]