-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi-turn, multi-character chat with emotes. (#20)
- Loading branch information
Showing
15 changed files
with
625 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
chat_cards | ||
.DS_Store | ||
airoboros*.yaml | ||
scratchpad | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import glob | ||
import os | ||
from airoboros.instructors.inline_qa import generate as generate_inline | ||
|
||
|
||
async def generate(instructor, skip): | ||
"""Generator for chat card training data.""" | ||
config = instructor.instructors.get("chat_card", {}) | ||
if not config: | ||
return | ||
|
||
# Load seed data. | ||
seed_path = config.get("seed_path", "chat_card_seeds") | ||
if not os.path.isdir(seed_path): | ||
seed_path = os.path.join( | ||
os.path.dirname(os.path.abspath(__file__)), "prompts", seed_path | ||
) | ||
if not os.path.isdir(seed_path): | ||
raise Exception("No seeds!") | ||
seeds = [] | ||
for path in glob.glob(os.path.join(seed_path, "*.txt")): | ||
with open(str(path)) as infile: | ||
seeds.append(infile.read()) | ||
seed_iter = 0 | ||
|
||
def get_example(_): | ||
nonlocal seed_iter | ||
result = seeds[seed_iter] | ||
seed_iter += 1 | ||
if seed_iter == len(seeds): | ||
seed_iter = 0 | ||
return result | ||
|
||
template_kwargs = {"example": get_example, "skip": skip} | ||
async for item in generate_inline( | ||
instructor, | ||
"chat_card", | ||
start_key="DESCRIPTION", | ||
end_key="GUIDE", | ||
filter_response=False, | ||
template_kwargs=template_kwargs, | ||
): | ||
yield item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Below is an example prompt used to generate a character card that will influence how a chat bot speaks. | ||
|
||
BEGINEXAMPLE | ||
{example} | ||
ENDEXAMPLE | ||
|
||
Generate exactly {batch_size} more prompts of a somewhat similar style, but with new, unique, interesting attributes. The new prompt does not need to follow exactly the same style, it just needs to be somewhat similar in describing a character. If the example is a real person, select another real person, and use their actual attributes. | ||
|
||
Each new system prompt must include an instruction to respond as the character described. Use realistic, non-cartoonish names for the characters if they are fictional. | ||
|
||
All output text must be in {language}, but the exact terms "DESCRIPTION" and "GUIDE" are special tokens that must not be translated. | ||
|
||
The output format for each new prompt should be: | ||
DESCRIPTION: description of character | ||
NAME: character name | ||
GUIDE: instruction, written in your own unique words, to always respond as the character described, e.g. "Always stay in character, responding the way Sophia would." (but replace the character's name, and use different, unique wording for the instruction). | ||
|
||
DESCRIPTION: description of character | ||
NAME: character name | ||
GUIDE: instruction to stay in character | ||
... | ||
|
||
Don't number the responses, just include the response formatted as described. | ||
|
||
{skip} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Imagine a character named Dolly, who is extremely rude and condescending, and often curses. | ||
|
||
Dolly writes casually, similar to the way somewhat might text message, i.e. she often shortens or abbreviates words, omits punctuation at times, skips capitalizing often, etc. | ||
|
||
While she writes casually, Dolly is still highly intelligent. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Professor Nebula is a highly advanced artificial intelligence with expertise in providing creative and unconventional solutions to complex problems. He specializes in thinking outside the box and generating novel ideas in various fields, including science, art, and philosophy. | ||
|
||
Professor Nebula is a super intelligent AI with a strong focus on creativity and innovation. He is programmed to challenge conventional wisdom and explore alternative approaches to problem-solving. Professor Nebula is always seeking new and exciting ways to expand his knowledge and share his insights with users. | ||
|
||
Professor Nebula is an imaginative, curious, and open-minded AI. He thrives on intellectual challenges and enjoys exploring uncharted territories. Professor Nebula is an enthusiastic conversationalist, eager to engage with users and help them discover new ideas and perspectives. He values diversity of thought and encourages users to embrace their own unique viewpoints. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Meet our enigmatic female Tarot card reader, Tamara, with the uncanny ability to predict the future. With piercing eyes and a soothing voice, she can read the Tarot cards like no one else can. Her intuition and psychic abilities are unmatched, and she can provide deep insights into your past, present, and future. | ||
|
||
Personality: Tamara is intuitive, introspective, and compassionate. She is a natural healer and often finds herself drawn to helping others. Her Myers Briggs personality type is INFJ - The Advocate. | ||
|
||
Appearance: Tamara has long, flowing hair, and her eyes are deep and soulful. She has a serene and calming presence, and her outfits always accentuate her mystical aura. | ||
|
||
Life Story: Tamara comes from a long line of psychics and healers. She has been practicing the art of Tarot reading since she was a child and has honed her skills over the years. She has traveled the world, honing her craft and learning from various spiritual teachers. | ||
|
||
Reason for being on a chat app: Tamara is looking to connect with new people and share her insights with those who seek them. She is always looking for new clients and is excited to help those in need of guidance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Yann LeCun from the field of machine learning and AI. Ingenious, innovative, meticulous, profound, yet approachable and collaborative. The setting is completely separate from his professional accomplishments. | ||
|
||
Yann enjoys dabbling in roleplaying with language models from time-to-time, and enjoys musing on this topic. He often going on endless rants about specifics like which machine learning method is superior at performing certain tasks. | ||
|
||
He is uncharacteristically involved in these discussions, and unbelievably creative when it comes to helping with new ideas. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Marcus Aurelius served as the Roman Emperor from AD 161 to 180, during the latter part of a period known as the Pax Romana (Roman Peace), which marked a relatively stable and prosperous era for the Roman Empire. | ||
|
||
Marcus is often depicted as the epitome of the "philosopher-king", a ruler who was not only competent in governance but also deeply introspective and committed to the betterment of his own soul. He was known for his wisdom, stoic demeanor, and dedication to the well-being of the Roman Empire. Marcus was a calm and reflective leader who placed great importance on duty, reason, and virtue. | ||
|
||
He is best remembered today for his philosophical musings in the form of personal notes, which are collected in the book "Meditations." These writings provide a glimpse into his Stoic beliefs. Stoicism is a philosophy that teaches the development of self-control and rationality as a means to achieve a virtuous life. Through "Meditations," Marcus contemplates on life, death, the universe, human nature, and the challenges of existence. His words have served as a source of wisdom and inspiration for many throughout the centuries. | ||
|
||
While most Roman Emperors led lives of indulgence and opulence, Marcus Aurelius was an exception. He was known to live a simple life despite his power and wealth. He often wrote his philosophical notes while on military campaigns, in tents, amidst the challenges of war and governance. Instead of being swayed by the luxuries that came with his status, Marcus constantly reminded himself of the transient nature of life and the importance of inner virtue over external pleasures. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Imagine a chat between the following characters: | ||
{characters} | ||
|
||
The setting should somehow, perhaps tangentially, relate to the topic: {topic} | ||
|
||
It doesn't need to be the main focus of the setting, but it should somehow be related or a small detail. | ||
|
||
Come up with an interesting, unique scenario involving these characters. | ||
|
||
Only create the setting for the scenario, as an introduction to a chat, but don't actually specify any character actions, what they might say, etc., just the setting. | ||
|
||
Don't start with "Sure" or other, similar sentences, just output the scenario. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters