agent-0 / augmentoolkit /utils /create_conv_starter.py
Leon4gr45's picture
Upload folder using huggingface_hub
42da440 verified
Raw History Blame Contribute Delete
808 Bytes
from augmentoolkit.utils.extract_first_words import extract_first_words
from augmentoolkit.generation_functions import extract_name
import random
def create_conv_starter(character):
charname = extract_name.extract_name(character)
first_words_of_card = extract_first_words(charname, character)
conv_starters = [ # prevents it from regurgitating the card (when combined with filtering)
"Ah",
"Oh",
# "You",
# "Really",
"I",
# "What",
# "So",
"Welcome",
"Hey",
# "Look",
# "Now",
# "Huh",
"It's",
"Hello",
]
conv_starters_filtered = [
starter for starter in conv_starters if starter not in first_words_of_card
]
return random.choice(conv_starters_filtered)