The KoboldAI horde bridge is typically configured by copying
KoboldAI-Horde-Bridge/clientData_template.py to clientData.py and
then editing the worker name, api key, and other settings. However
the bridge spawned by the local KoboldAI server was always using
hardcoded "anonymous" worker settings. To make it easier for people
to use their actual API key and specify a worker name, this change
modifies the bridge startup to attempt to import settings from
clientData.py. If clientData.py doesn't exist then we fall back
to using the default settings, and if the user hasn't edited the
worker name then we also generate a randomized name.
Also clear the horde bridge pid when stopping the bridge so that
it can be restarted within the same session.
The maximum memory length was hardcoded to 512 tokens independent of
the overall context token budget. This was restrictive when the token
budget was increased, and excessive when the budget was decreased.
Based on feedback, this change modifies the max memory length to be 50%
of the context length. I tested with a memory consisting of the first
five paragraphs of The Three Musketeers, and the change seemed
reasonable with context lengths of 512, 1024 and 2048.
In order to minimize changes, this commit only modifies
max_memory_length; max_prompt_length and max_authornote_length are still
hardcoded as 512 tokens. We might want to make the max prompt length
flexible in the future, but since the author's note is injected into
the story, it's probably fine to restrict its length since a long
author's note will likely derail the AI.
The art guide now optionally supports the sequence <|>
If this exists in the art guide, <|> is replaced by the story summary.
Otherwise, the art guide is appended to the summary as before.
Update the default art guide to place the medium before the summary.
Also update the art guide tooltip to include the new default.