I switched from llamacpp to koboldcpp. Koboldcpp is really really fast because it can use gpu. The problem is that I’m having a hard time to get it to generate long enough outputs.

“write an essay about the history of the moon. It needs to be at least 500 words” for example is a prompt where the same model will give me an output that’s actually that long on llamacpp. Koboldcpp never gives me more than about 70 words per response. Pressing enter to make the ai continue writing or asking it to continue doesn’t work as well in my koboldcpp setup as it does on llamacpp. I’ve set the tokens to generate to 512, the highest number. I’ve set the context tokens to 4096.

What else can I do to try to get longer responses?

  • ffhein@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    4 months ago

    llama.cpp uses the gpu if you compile it with gpu support and you tell it to use the gpu…

    Never used koboldcpp, so I don’t know why it would it would give you shorter responses if both the model and the prompt are the same (also assuming you’ve generated multiple times, and it’s always the same). If you don’t want to use discord to visit the official koboldcpp server, you might get more answers from a more llm-focused community such as !localllama@sh.itjust.works

  • apprehentice@lemmy.enchanted.social
    link
    fedilink
    English
    arrow-up
    3
    ·
    4 months ago

    You’re part of the way there by setting the token count higher. Context will make the model “remember” more, so that’s helpful for generating responses up to the token count.

    If you haven’t already, go into the settings menu and make sure “Continue bot responses” is turned on. If it is, pressing the submit button with no input should make the bot add onto what it output before.

    • PenisWenisGenius@lemmynsfw.comOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      4 months ago

      I think I might be on to something that contributes to the problem. The built-in “KoboldGPT chat” option puts some example queries in its context memory. They aren’t very long responses so I think it’s just seeing that and using it as a guideline for what to say which results in shorter answers.

      If I use the “new chat” option instead of “KoboldGPT chat”, it makes it so that nothing is in the context. No prompt and no memory. This way when I tell it to write 500 words of crap, it doesn’t quite write that much but it’s a lot better than before. Pressing enter to make it generate more text works more often this way too.

    • ffhein@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 months ago

      Is max tokens different from context size?

      Might be worth keeping in mind that the generated tokens go into the context, so if you set it to 1k with 4k context you only get 3k left for character card and chat history. I think i usually have it set to 400 tokens or something, and use TGW’s continue button in case a long response gets cut off

      • tal
        link
        fedilink
        English
        arrow-up
        2
        ·
        4 months ago

        Is max tokens different from context size?

        No. Same thing. If you hover over the question mark by “Max Tokens” in the Kobold AI Web UI:

        “Max number of tokens of context to submit to the AI for sampling. Make sure this is higher than Amount to Generate. Higher values increase VRAM/RAM usage.”