Code Monkey home page Code Monkey logo

Comments (8)

Kozonak avatar Kozonak commented on July 3, 2024 2

I see its default set to 2048 which seems to be roughly 1500 words. Wouldnt it make sense to load the persona from a dedicated file instead? Might be easier to switch and keep it cleaner instead of replacing the whole text in the config file with all the other settings.

from oobabot.

chrisrude avatar chrisrude commented on July 3, 2024 1

The bulk of the config file work is done in b29ead8

It still needs some more work and documentation, and probably a few days of live testing before it gets released. It was a surprising amount of work!

from oobabot.

chrisrude avatar chrisrude commented on July 3, 2024

Looking for feedback from folks on the following config file format. Are there concerns that you would have if the file looked like this?

It will let you set:

  • everything you can set now from the command line
  • custom templates for all AI prompt strings and user-facing UI strings
  • all the request params that get sent to oobabooga and stable diffusion
_version: 0.1.6

discord:
    discord_token: ''
    dont_split_responses: false
    history_lines: 7
    ignore_dms: false
    reply_in_thread: false

oobabooga:
    base_url: ws://localhost:5005
    log_all_the_things: false
    request_params:
        add_bos_token: true
        ban_eos_token: false
        do_sample: true
        early_stopping: false
        length_penalty: 1
        max_new_tokens: 250
        min_length: 0
        no_repeat_ngram_size: 0
        num_beams: 1
        penalty_alpha: 0
        repetition_penalty: 1.18
        seed: -1
        skip_special_tokens: true
        stopping_strings: []
        temperature: 1.3
        top_k: 40
        top_p: 0.1
        truncation_length: 730
        typical_p: 1

persona:
    ai_name: oobabot
    persona: ''
    wakewords: [oobabot]

stable diffusion:
    image_words: [drawing, photo, pic, picture, image, sketch]
    negative_prompt_nsfw: animal harm, suicide, self-harm, excessive violence, naked
        children, child sexualization, lolicon
    request_params:
        do_not_save_grid: true
        do_not_save_samples: true
        height: 512
        negative_prompt: animal harm, suicide, self-harm, excessive violence, naked
            children, child sexualization, lolicon, sexually explicit content
        prompt: ''
        sampler: ''
        steps: 30
        width: 512
    url: ''

templates:
    command_lobotomize_response: '

        Ummmm... what were we talking about?

        '
    image_confirmation: "\n{USER_NAME}, is this what you wanted?\nIf no choice is\
        \ made, this message will \U0001F4A3 self-destuct \U0001F4A3 in 3 minutes.\n"
    image_detach: "\n{USER_NAME} tried to make an image with the prompt:\n    '{IMAGE_PROMPT}'\n\
        ...but couldn't find a suitable one.\n"
    image_generation_error: '

        Something went wrong generating your image.  Sorry about that!

        '
    image_unauthorized: '

        Sorry, only {USER_NAME} can press the buttons.

        '
    prompt: '

        You are in a chat room with multiple participants.

        Below is a transcript of recent messages in the conversation.

        Write the next one to three messages that you would send in this

        conversation, from the point of view of the participant named

        {AI_NAME}.


        {PERSONA}


        All responses you write must be from the point of view of

        {AI_NAME}.

        ### Transcript:

        {MESSAGE_HISTORY}

        {IMAGE_COMING}

        '
    prompt_history_line: '

        {USER_NAME} says:

        {USER_MESSAGE}


        '
    prompt_image_coming: '

        {AI_NAME}: is currently generating an image, as requested.

        '

from oobabot.

Skrownerve avatar Skrownerve commented on July 3, 2024

That all looks good to me. Seems to have everything I want to see in there, except the ability to change the total token limit. I saw you're working on that though. I'm going to have to avoid 0.1.6 due to the token limit change. Around 700 is almost as bad as I was getting when it was bugged. ☚ī¸

I also am not sure that those negative prompts are all that great. If the intent is to avoid certain content being generated, I think you'd be better off having the bot refuse to send any prompt with those words in it. "child, loli" is probably enough to avoid child-like characters in NSFW generations, though there's no way to make it foolproof. "NSFW, nude" is probably enough to avoid sexual content in non-NSFW generations, though it's highly dependent on the model being used as well.

from oobabot.

chrisrude avatar chrisrude commented on July 3, 2024

@Skrownerve thanks for the feedback!

truncation_length is what oobabooga calls "token limit" in its API. So you can change that. I'll aim to add comments to the yaml to make it more clear what it does.

I'm planning to pass the oobabooga names untouched, so that if they add/remove new values in the future, users can just update the config rather than need a new build.

from oobabot.

Kozonak avatar Kozonak commented on July 3, 2024

Is there a limit to the persona description length?

from oobabot.

chrisrude avatar chrisrude commented on July 3, 2024

@Kozonak yes, though it's based on a number of factors.

Ultimately, we have a fixed budget of tokens in which we need to fit both the prompt and the AI's response. This is the truncation_length set above, and is determined by the model running on Oobabooga.

Into this fixed budget we need to fit:

  • the AI's response
  • the persona
  • the message history
  • some other prompt overhead explaining what we want the AI to do with the persona and message history

On startup, oobabot will do some rough estimates on all this and will throw an error if it thinks there's no way it's going to fit. This is to try and help the user understand why things are about to go haywire, since when you run out of token space, the main failure mode is short or nonsensical replies from the AI.

If we're short on the token budget, there are a few ways to resolve it:

  • increasing the truncation_length
  • decreasing the number of lines of history the bot sees
  • shortening the prompt

So in short... the ultimate limit is the truncation_length of the model (aka token limit). Within this, you'll be able to divide it up as you'd like by balancing persona size vs message history size.

from oobabot.

chrisrude avatar chrisrude commented on July 3, 2024

v.0.1.7 is out, have fun with it!

I disabled templating at the last minute, since I wasn't happy with how it was working. I can add it back in a future release after some more tweaks.

I also want to make some other improvements, but calling this task good for now. All of the things in the original post are done!

from oobabot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.