Browse Source

koboldai-style prompt

master
Hendrik Langer 2 years ago
parent
commit
d28b86294d
  1. 13
      matrix_pygmalion_bot/ai/model_helpers.py

13
matrix_pygmalion_bot/ai/model_helpers.py

@ -45,6 +45,9 @@ async def get_full_prompt(simple_prompt: str, bot, chat_history, model_name: str
elif model_name.startswith("alpaca"): elif model_name.startswith("alpaca"):
ai_name = bot.name # ToDo ai_name = bot.name # ToDo
user_name = bot.user_name # ToDo user_name = bot.user_name # ToDo
elif mode_name.startswith("koboldai"):
ai_name = bot.name
user_name = "You"
else: else:
ai_name = bot.name ai_name = bot.name
user_name = bot.user_name user_name = bot.user_name
@ -66,6 +69,8 @@ async def get_full_prompt(simple_prompt: str, bot, chat_history, model_name: str
prompt += f"NSFW content allowed.\n" # ToDo prompt += f"NSFW content allowed.\n" # ToDo
prompt += f"\n" prompt += f"\n"
prompt += "### Input:\n" prompt += "### Input:\n"
elif mode_name.startswith("koboldai"):
prompt = ""
else: else:
prompt = "" prompt = ""
@ -76,6 +81,8 @@ async def get_full_prompt(simple_prompt: str, bot, chat_history, model_name: str
prompt += bot.name + "'s Persona: " + bot.get_persona() + "\n" # ToDo prompt += bot.name + "'s Persona: " + bot.get_persona() + "\n" # ToDo
elif model_name.startswith("alpaca"): elif model_name.startswith("alpaca"):
prompt += bot.name + "'s Persona: " + bot.get_persona() + "\n" # ToDo prompt += bot.name + "'s Persona: " + bot.get_persona() + "\n" # ToDo
elif mode_name.startswith("koboldai"):
prompt = f"[Character: {bot.get_persona()}]\n"
else: else:
prompt += bot.name + "'s Persona: " + bot.get_persona() + "\n" # ToDo prompt += bot.name + "'s Persona: " + bot.get_persona() + "\n" # ToDo
@ -86,6 +93,8 @@ async def get_full_prompt(simple_prompt: str, bot, chat_history, model_name: str
prompt += "Scenario: " + bot.get_scenario() + "\n\n" # ToDo prompt += "Scenario: " + bot.get_scenario() + "\n\n" # ToDo
elif model_name.startswith("alpaca"): elif model_name.startswith("alpaca"):
prompt += "Scenario: " + bot.get_scenario() + "\n\n" # ToDo prompt += "Scenario: " + bot.get_scenario() + "\n\n" # ToDo
elif mode_name.startswith("koboldai"):
prompt = f"[Start Scene: {bot.get_scenario()}]\n\n"
else: else:
prompt += "Scenario: " + bot.get_scenario() + "\n\n" # ToDo prompt += "Scenario: " + bot.get_scenario() + "\n\n" # ToDo
@ -96,6 +105,8 @@ async def get_full_prompt(simple_prompt: str, bot, chat_history, model_name: str
prompt += "### Response:\n" # ToDo prompt += "### Response:\n" # ToDo
elif model_name.startswith("alpaca"): elif model_name.startswith("alpaca"):
prompt += "### Response:\n" prompt += "### Response:\n"
elif mode_name.startswith("koboldai"):
pass
else: else:
pass pass
@ -114,6 +125,8 @@ async def get_full_prompt(simple_prompt: str, bot, chat_history, model_name: str
pass # ToDo pass # ToDo
elif model_name.startswith("alpaca"): elif model_name.startswith("alpaca"):
pass # ToDo pass # ToDo
elif mode_name.startswith("koboldai"):
pass
else: else:
pass # ToDo pass # ToDo

Loading…
Cancel
Save