Merge pull request #3881 from DreamGenX/dg_lucid DreamGen Lucid
Signed| @@ -1419,7 +1419,7 @@ | |||
| 1419 | </div> | 1419 | </div> |
| 1420 | </div> | 1420 | </div> |
| 1421 | 1421 | ||
| 1422 | <div data-tg-type="aphrodite, ooba, koboldcpp, tabby, llamacpp" id="dryBlock" class="wide100p"> | 1422 | <div data-tg-type="aphrodite, ooba, koboldcpp, tabby, llamacpp, dreamgen" id="dryBlock" class="wide100p"> |
| 1423 | <h4 class="wide100p textAlignCenter" title="DRY penalizes tokens that would extend the end of the input into a sequence that has previously occurred in the input. Set multiplier to 0 to disable." data-i18n="[title]DRY_Repetition_Penalty_desc"> | 1423 | <h4 class="wide100p textAlignCenter" title="DRY penalizes tokens that would extend the end of the input into a sequence that has previously occurred in the input. Set multiplier to 0 to disable." data-i18n="[title]DRY_Repetition_Penalty_desc"> |
| 1424 | <label data-i18n="DRY Repetition Penalty">DRY Repetition Penalty</label> | 1424 | <label data-i18n="DRY Repetition Penalty">DRY Repetition Penalty</label> |
| 1425 | <a href="https://github.com/oobabooga/text-generation-webui/pull/5677" target="_blank"> | 1425 | <a href="https://github.com/oobabooga/text-generation-webui/pull/5677" target="_blank"> |
| @@ -1574,7 +1574,7 @@ | |||
| 1574 | <div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Add the bos_token to the beginning of prompts. Disabling this can make the replies more creative" title="Add the bos_token to the beginning of prompts. Disabling this can make the replies more creative."></div> | 1574 | <div class="fa-solid fa-circle-info opacity50p " data-i18n="[title]Add the bos_token to the beginning of prompts. Disabling this can make the replies more creative" title="Add the bos_token to the beginning of prompts. Disabling this can make the replies more creative."></div> |
| 1575 | </label> | 1575 | </label> |
| 1576 | </label> | 1576 | </label> |
| 1577 | <label data-tg-type="ooba, llamacpp, tabby, koboldcpp" class="checkbox_label flexGrow flexShrink" for="ban_eos_token_textgenerationwebui"> | 1577 | <label data-tg-type="ooba, llamacpp, tabby, koboldcpp, dreamgen" class="checkbox_label flexGrow flexShrink" for="ban_eos_token_textgenerationwebui"> |
| 1578 | <input type="checkbox" id="ban_eos_token_textgenerationwebui" /> | 1578 | <input type="checkbox" id="ban_eos_token_textgenerationwebui" /> |
| 1579 | <label> | 1579 | <label> |
| 1580 | <small data-i18n="Ban EOS Token">Ban EOS Token</small> | 1580 | <small data-i18n="Ban EOS Token">Ban EOS Token</small> |
| @@ -928,6 +928,10 @@ export function getCurrentDreamGenModelTokenizer() { | |||
| 928 | return tokenizers.YI; | 928 | return tokenizers.YI; |
| 929 | } else if (model.id.startsWith('opus-v1-xl')) { | 929 | } else if (model.id.startsWith('opus-v1-xl')) { |
| 930 | return tokenizers.LLAMA; | 930 | return tokenizers.LLAMA; |
| 931 | } else if (model.id.startsWith('lucid-v1-medium')) { | ||
| 932 | return tokenizers.NEMO; | ||
| 933 | } else if (model.id.startsWith('lucid-v1-extra-large')) { | ||
| 934 | return tokenizers.LLAMA3; | ||
| 931 | } else { | 935 | } else { |
| 932 | return tokenizers.MISTRAL; | 936 | return tokenizers.MISTRAL; |
| 933 | } | 937 | } |
| @@ -268,23 +268,6 @@ export const FEATHERLESS_KEYS = [ | |||
| 268 | 'guided_whitespace_pattern', | 268 | 'guided_whitespace_pattern', |
| 269 | ]; | 269 | ]; |
| 270 | 270 | ||
| 271 | // https://dreamgen.com/docs/api#openai-text | ||
| 272 | export const DREAMGEN_KEYS = [ | ||
| 273 | 'model', | ||
| 274 | 'prompt', | ||
| 275 | 'max_tokens', | ||
| 276 | 'temperature', | ||
| 277 | 'top_p', | ||
| 278 | 'top_k', | ||
| 279 | 'min_p', | ||
| 280 | 'repetition_penalty', | ||
| 281 | 'frequency_penalty', | ||
| 282 | 'presence_penalty', | ||
| 283 | 'stop', | ||
| 284 | 'stream', | ||
| 285 | 'minimum_message_content_tokens', | ||
| 286 | ]; | ||
| 287 | |||
| 288 | // https://docs.together.ai/reference/completions | 271 | // https://docs.together.ai/reference/completions |
| 289 | export const TOGETHERAI_KEYS = [ | 272 | export const TOGETHERAI_KEYS = [ |
| 290 | 'model', | 273 | 'model', |
| @@ -10,7 +10,6 @@ import { | |||
| 10 | INFERMATICAI_KEYS, | 10 | INFERMATICAI_KEYS, |
| 11 | OPENROUTER_KEYS, | 11 | OPENROUTER_KEYS, |
| 12 | VLLM_KEYS, | 12 | VLLM_KEYS, |
| 13 | DREAMGEN_KEYS, | ||
| 14 | FEATHERLESS_KEYS, | 13 | FEATHERLESS_KEYS, |
| 15 | OPENAI_KEYS, | 14 | OPENAI_KEYS, |
| 16 | } from '../../constants.js'; | 15 | } from '../../constants.js'; |
| @@ -340,9 +339,6 @@ router.post('/generate', async function (request, response) { | |||
| 340 | } | 339 | } |
| 341 | 340 | ||
| 342 | if (request.body.api_type === TEXTGEN_TYPES.DREAMGEN) { | 341 | if (request.body.api_type === TEXTGEN_TYPES.DREAMGEN) { |
| 343 | request.body = _.pickBy(request.body, (_, key) => DREAMGEN_KEYS.includes(key)); | ||
| 344 | // NOTE: DreamGen sometimes get confused by the unusual formatting in the character cards. | ||
| 345 | request.body.stop?.push('### User', '## User'); | ||
| 346 | args.body = JSON.stringify(request.body); | 342 | args.body = JSON.stringify(request.body); |
| 347 | } | 343 | } |
| 348 | 344 | ||