From 35991ff5d60adb003c27184c6aceb35f60de23cd Mon Sep 17 00:00:00 2001 From: jialin Date: Tue, 14 Jan 2025 18:56:21 +0800 Subject: [PATCH] chore: llama-box parameters --- .../logs-viewer/parse-worker-copy.ts | 164 ------ .../logs-viewer/virtual-log-list-copy.tsx | 377 -------------- .../components/deploy-builtin-modal.tsx | 11 +- .../llmodels/components/hf-model-file.tsx | 8 +- src/pages/llmodels/config/llama-config.ts | 482 +++++++++++++++++- .../playground/components/ground-images.tsx | 2 +- .../playground/components/image-edit.tsx | 2 +- src/pages/playground/config/params-config.ts | 4 +- src/pages/resources/config/index.ts | 2 +- 9 files changed, 498 insertions(+), 554 deletions(-) delete mode 100644 src/components/logs-viewer/parse-worker-copy.ts delete mode 100644 src/components/logs-viewer/virtual-log-list-copy.tsx diff --git a/src/components/logs-viewer/parse-worker-copy.ts b/src/components/logs-viewer/parse-worker-copy.ts deleted file mode 100644 index e179653f..00000000 --- a/src/components/logs-viewer/parse-worker-copy.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { controlSeqRegex } from './config'; - -let uid = 0; - -const setId = () => { - uid += 1; - return uid; -}; - -const removeBrackets = (str: string) => { - return str?.replace?.(/^\(…\)/, ''); -}; - -const isClean = (input: string) => { - let match = controlSeqRegex.exec(input) || []; - const command = match?.[3]; - const n = parseInt(match?.[1], 10) || 1; - return command === 'J' && n === 2; -}; - -const parseAnsi = (input: string, setId: () => number) => { - let cursorRow = 0; - let cursorCol = 0; - let screen = [['']]; - let lastIndex = 0; - let rawDataRows = 1; - - // handle the \r and \n characters in the text - const handleText = (text: string) => { - let processed = ''; - for (let char of text) { - if (char === '\r') { - cursorCol = 0; // move to the beginning of the line - } else if (char === '\n') { - rawDataRows++; - cursorRow++; // move to the next line - cursorCol = 0; // move to the beginning of the line - screen[cursorRow] = screen[cursorRow] || ['']; // create a new line if it does not exist - } else { - // add the character to the screen content array - screen[cursorRow][cursorCol] = char; - cursorCol++; - } - } - return processed; - }; - - let output = ''; // output text - - let match; - - // ANSI color map - const colorMap: Record = { - '30': 'black', - '31': 'red', - '32': 'green', - '33': 'yellow', - '34': 'blue', - '35': 'magenta', - '36': 'cyan', - '37': 'white' - }; - - let currentStyle = ''; // current text style - - // match ANSI control characters - while ((match = controlSeqRegex.exec(input)) !== null) { - // handle text before the control character - let textBeforeControl = input.slice(lastIndex, match.index); - output += handleText(textBeforeControl); // add the processed text to the output - lastIndex = controlSeqRegex.lastIndex; // update the last index - - const n = parseInt(match[1], 10) || 1; - const m = parseInt(match[2], 10) || 1; - const command = match[3]; - - // handle ANSI control characters - switch (command) { - case 'A': // up - cursorRow = Math.max(0, cursorRow - n); - if (cursorRow === 0) { - // screen = [['']]; - // cursorCol = 0; - } - break; - case 'B': // down - cursorRow += n; - break; - case 'C': // right - cursorCol += n; - break; - case 'D': // left - cursorCol = Math.max(0, cursorCol - n); - break; - case 'H': // move the cursor to the specified position (n, m) - cursorRow = Math.max(0, n - 1); - cursorCol = Math.max(0, m - 1); - break; - case 'J': // clear the screen - if (n === 2) { - console.log('clear===='); - screen = [['']]; - cursorRow = 0; - cursorCol = 0; - } - break; - case 'm': - // if (match[1] === '0') { - // currentStyle = ''; - // } else if (colorMap[match[1]]) { - // currentStyle = `color: ${colorMap[match[1]]};`; - // } - break; - } - - // check if the row and column are within the screen content array - while (screen.length <= cursorRow) { - screen.push(['']); - } - while (screen[cursorRow].length <= cursorCol) { - screen[cursorRow].push(''); - } - } - - // handle the remaining text - output += handleText(input.slice(lastIndex)); - - let result = []; - for (let row = 0; row < screen.length; row++) { - let rowContent = screen[row].join(''); - result.push({ - content: removeBrackets(rowContent), - uid: setId() - }); - } - result.push({ - content: output, - uid: setId() - }); - - return { - data: result, - lines: rawDataRows - }; -}; - -self.onmessage = function (event) { - const { inputStr } = event.data; - - const { data: parsedData, lines } = parseAnsi(inputStr, setId); - - const result = parsedData.map((item) => ({ - content: item.content, - uid: item.uid - })); - self.postMessage({ - result, - lines - }); -}; - -self.onerror = function (event) { - console.error('parse logs error===', event); -}; diff --git a/src/components/logs-viewer/virtual-log-list-copy.tsx b/src/components/logs-viewer/virtual-log-list-copy.tsx deleted file mode 100644 index 6cd7ce41..00000000 --- a/src/components/logs-viewer/virtual-log-list-copy.tsx +++ /dev/null @@ -1,377 +0,0 @@ -import useSetChunkFetch from '@/hooks/use-chunk-fetch'; -import { Spin } from 'antd'; -import classNames from 'classnames'; -import _ from 'lodash'; -import React, { - forwardRef, - memo, - useCallback, - useEffect, - useImperativeHandle, - useRef, - useState -} from 'react'; -import { controlSeqRegex, replaceLineRegex } from './config'; -import LogsList from './logs-list'; -import LogsPagination from './logs-pagination'; -import './styles/index.less'; -import useLogsPagination from './use-logs-pagination'; - -interface LogsViewerProps { - height: number; - content?: string; - url: string; - params?: object; - ref?: any; - tail?: number; - enableScorllLoad?: boolean; - diffHeight?: number; -} -const LogsViewer: React.FC = forwardRef((props, ref) => { - const { diffHeight, url, tail: defaultTail, enableScorllLoad = true } = props; - const { pageSize, page, setPage, setTotalPage, totalPage } = - useLogsPagination(); - const { setChunkFetch } = useSetChunkFetch(); - const chunkRequedtRef = useRef(null); - const cacheDataRef = useRef(''); - const [logs, setLogs] = useState([]); - const logParseWorker = useRef(null); - const tail = useRef(defaultTail); - const [isLoadend, setIsLoadend] = useState(false); - const [loading, setLoading] = useState(false); - const [isAtTop, setIsAtTop] = useState(false); - const [scrollPos, setScrollPos] = useState([]); - const logListRef = useRef(null); - const loadMoreDone = useRef(false); - const pageRef = useRef(page); - const totalPageRef = useRef(totalPage); - const isLoadingMoreRef = useRef(false); - const scrollPosRef = useRef({ - pos: 'bottom', - page: 1 - }); - const dataLengthRef = useRef(0); - const lineCountRef = useRef(0); - - useImperativeHandle(ref, () => ({ - abort() { - chunkRequedtRef.current?.current?.abort?.(); - logParseWorker.current?.terminate?.(); - } - })); - - useEffect(() => { - logParseWorker.current?.terminate?.(); - - logParseWorker.current = new Worker( - // @ts-ignore - new URL('./parse-worker.ts', import.meta.url), - { - type: 'module' - } - ); - - logParseWorker.current.onmessage = (event: any) => { - const { result, lines } = event.data; - lineCountRef.current = lines; - setLogs(result); - }; - - return () => { - if (logParseWorker.current) { - logParseWorker.current.terminate(); - } - }; - }, []); - - const debounceLoading = _.debounce(() => { - setLoading(false); - isLoadingMoreRef.current = false; - }, 200); - - const isClean = useCallback((input: string) => { - let match = controlSeqRegex.exec(input) || []; - const command = match?.[3]; - const n = parseInt(match?.[1], 10) || 1; - return command === 'J' && n === 2; - }, []); - - const getLastPage = (data: string) => { - const list = _.split(data.trim(), '\n'); - let result = ''; - - const totalPage = Math.ceil(list.length / pageSize); - - pageRef.current = totalPage; - totalPageRef.current = totalPage; - const lastPageLogs = list.slice(-pageSize).join('\n'); - - result = lastPageLogs; - - setPage(totalPage); - setTotalPage(totalPage); - setScrollPos(['bottom', totalPage]); - scrollPosRef.current = { - pos: 'bottom', - page: totalPage - }; - - return result; - }; - - const getCurrentPage = () => { - const list = _.split(cacheDataRef.current.trim(), '\n'); - const totalPage = Math.ceil(list.length / pageSize); - let newPage = pageRef.current; - if (newPage < 1) { - newPage = 1; - } - if (isLoadingMoreRef.current) { - setLoading(true); - } - const start = (newPage - 1) * pageSize; - const end = newPage * pageSize; - const currentPage = list.slice(start, end).join('\n'); - setPage(newPage); - setTotalPage(totalPage); - if ( - pageRef.current === totalPageRef.current && - scrollPosRef.current.pos === 'bottom' - ) { - setScrollPos(['bottom', newPage]); - scrollPosRef.current = { - pos: 'bottom', - page: newPage - }; - } - debounceLoading(); - pageRef.current = newPage; - logParseWorker.current.postMessage({ - inputStr: currentPage - }); - }; - - const getPrePage = useCallback(() => { - const list = _.split(cacheDataRef.current.trim(), '\n'); - let newPage = page - 1; - if (newPage < 1) { - newPage = 1; - } - const start = (newPage - 1) * pageSize; - const end = newPage * pageSize; - const prePage = list.slice(start, end).join('\n'); - - setPage(() => newPage); - setScrollPos(['bottom', newPage]); - scrollPosRef.current = { - pos: 'bottom', - page: newPage - }; - pageRef.current = newPage; - logParseWorker.current.postMessage({ - inputStr: prePage - }); - }, [page, pageSize]); - - const getNextPage = useCallback(() => { - const list = _.split(cacheDataRef.current.trim(), '\n'); - let newPage = page + 1; - if (newPage > totalPage) { - newPage = totalPage; - } - const start = (newPage - 1) * pageSize; - const end = newPage * pageSize; - const nextPage = list.slice(start, end).join('\n'); - - setPage(() => newPage); - setScrollPos(['top', newPage]); - scrollPosRef.current = { - pos: 'top', - page: newPage - }; - pageRef.current = newPage; - logParseWorker.current.postMessage({ - inputStr: nextPage - }); - }, [totalPage, page, pageSize]); - - const handleonBackend = useCallback(() => { - const list = _.split(cacheDataRef.current.trim(), '\n'); - let newPage = totalPage; - const start = (newPage - 1) * pageSize; - const end = newPage * pageSize; - const nextPage = list.slice(start, end).join('\n'); - setPage(() => newPage); - setScrollPos(['bottom', newPage]); - scrollPosRef.current = { - pos: 'bottom', - page: newPage - }; - pageRef.current = totalPage; - totalPageRef.current = totalPage; - logParseWorker.current.postMessage({ - inputStr: nextPage - }); - }, [totalPage, page, pageSize]); - - const updateContent = (inputStr: string) => { - const data = inputStr.replace(replaceLineRegex, '\n'); - if (isClean(data)) { - cacheDataRef.current = data; - } else { - cacheDataRef.current += data; - } - if ( - pageRef.current === totalPageRef.current && - scrollPosRef.current.pos === 'bottom' - ) { - logParseWorker.current.postMessage({ - inputStr: getLastPage(cacheDataRef.current) - }); - } else { - getCurrentPage(); - } - }; - - const createChunkConnection = async () => { - cacheDataRef.current = ''; - chunkRequedtRef.current?.current?.abort?.(); - - chunkRequedtRef.current = setChunkFetch({ - url, - params: { - ...props.params, - tail: tail.current, - watch: true - }, - contentType: 'text', - handler: updateContent - }); - }; - - const handleOnScroll = useCallback( - async (data: { isTop: boolean; isBottom: boolean }) => { - const { isTop, isBottom } = data; - setIsAtTop(isTop); - console.log('scroll========', { - isTop, - isBottom, - loadMoreDone: loadMoreDone.current, - loading: loading, - lineCount: lineCountRef.current, - dataLength: dataLengthRef.current - }); - if (isBottom) { - scrollPosRef.current = { - pos: 'bottom', - page: page - }; - } else if (isTop) { - scrollPosRef.current = { - pos: 'top', - page: page - }; - } else { - scrollPosRef.current = { - pos: 'middle', - page: page - }; - } - if ( - loading || - (logs.length > 0 && - lineCountRef.current < pageSize && - !loadMoreDone.current) || - !enableScorllLoad - ) { - return; - } - - if (isTop && !loadMoreDone.current) { - tail.current = undefined; - createChunkConnection(); - loadMoreDone.current = true; - isLoadingMoreRef.current = true; - } else if (isTop && page <= totalPage && page > 1) { - // getPrePage(); - } else if (isBottom && page < totalPage) { - // getNextPage(); - } - }, - [ - loading, - logs.length, - pageSize, - enableScorllLoad, - page, - totalPage, - setScrollPos, - createChunkConnection - ] - ); - - const debouncedScroll = useCallback( - _.debounce(() => { - console.log('scrollPos+++++++++++=', scrollPos); - if (scrollPos[0] === 'top' && scrollPosRef.current.pos === 'top') { - logListRef.current?.scrollToTop(); - } - if (scrollPos[0] === 'bottom' && scrollPosRef.current.pos === 'bottom') { - logListRef.current?.scrollToBottom(); - } - }, 150), - [scrollPos] - ); - - useEffect(() => { - createChunkConnection(); - return () => { - chunkRequedtRef.current?.current?.abort?.(); - }; - }, [url, props.params]); - - useEffect(() => { - debouncedScroll(); - }, [scrollPos]); - - return ( -
-
-
- -
- - {totalPage > 1 && ( -
-
- -
-
- )} -
-
- ); -}); - -export default memo(LogsViewer); diff --git a/src/pages/llmodels/components/deploy-builtin-modal.tsx b/src/pages/llmodels/components/deploy-builtin-modal.tsx index 8a567e26..701a8efe 100644 --- a/src/pages/llmodels/components/deploy-builtin-modal.tsx +++ b/src/pages/llmodels/components/deploy-builtin-modal.tsx @@ -2,7 +2,6 @@ import ModalFooter from '@/components/modal-footer'; import { PageActionType } from '@/config/types'; import { createAxiosToken } from '@/hooks/use-chunk-request'; import { CloseOutlined } from '@ant-design/icons'; -import { useIntl } from '@umijs/max'; import { Button, Drawer } from 'antd'; import _ from 'lodash'; import { memo, useCallback, useEffect, useRef, useState } from 'react'; @@ -44,6 +43,13 @@ const backendOptions = [ } ]; +const quantiCapitMap: Record = { + F16: 'FP16', + f16: 'FP16', + F32: 'FP32', + f32: 'FP32' +}; + const defaultQuant = ['Q4_K_M']; const EmbeddingRerankFirstQuant = ['FP16']; const AddModal: React.FC = (props) => { @@ -59,7 +65,6 @@ const AddModal: React.FC = (props) => { } = props || {}; const form = useRef({}); - const intl = useIntl(); const [isGGUF, setIsGGUF] = useState(false); const [sourceList, setSourceList] = useState([]); @@ -185,7 +190,7 @@ const AddModal: React.FC = (props) => { const quantizationList = _.map(sizeGroup, (item: CatalogSpec) => { return { - label: item.quantization, + label: quantiCapitMap[item.quantization] ?? item.quantization, value: item.quantization }; }); diff --git a/src/pages/llmodels/components/hf-model-file.tsx b/src/pages/llmodels/components/hf-model-file.tsx index 721b1fc9..9a4aa8fe 100644 --- a/src/pages/llmodels/components/hf-model-file.tsx +++ b/src/pages/llmodels/components/hf-model-file.tsx @@ -143,7 +143,7 @@ const HFModelFile: React.FC = forwardRef((props, ref) => { }); const list = _.filter(fileList, (file: any) => { - return hfFileFilter(file); + return hfFileFilter(file) && file.path.indexOf('mmproj') === -1; }); return list; @@ -153,7 +153,11 @@ const HFModelFile: React.FC = forwardRef((props, ref) => { }; const modelscopeFileFilter = (file: any) => { - return filterRegGGUF.test(file.Path) && file.Type === 'blob'; + return ( + filterRegGGUF.test(file.Path) && + file.Type === 'blob' && + file.Path.indexOf('mmproj') === -1 + ); }; // modelscope files diff --git a/src/pages/llmodels/config/llama-config.ts b/src/pages/llmodels/config/llama-config.ts index 33947ca9..0a8f7d53 100644 --- a/src/pages/llmodels/config/llama-config.ts +++ b/src/pages/llmodels/config/llama-config.ts @@ -1,7 +1,200 @@ const options = [ + { + label: '--verbose', + value: '--verbose' + }, + { + label: '--verbosity', + value: '--verbosity' + }, + { + label: '--host', + value: '--host' + }, + { + label: '--port', + value: '--port' + }, + { + label: '--timeout', + value: '--timeout' + }, + { + label: '--threads-http', + value: '--threads-http' + }, + { + label: '--conn-idle', + value: '--conn-idle' + }, + { + label: '--lora', + value: '--lora' + }, + { + label: '--lora-scaled', + value: '--lora-scaled' + }, + { + label: '--conn-keepalive', + value: '--conn-keepalive' + }, + { + label: '--lora-init-without-apply', + value: '--lora-init-without-apply' + }, + { + label: '--seed', + value: '--seed' + }, + { + label: '--main-gpu', + value: '--main-gpu' + }, + { + label: '--flash-attn', + value: '--flash-attn' + }, + { + label: '--metrics', + value: '--metrics' + }, + { + label: '--slots', + value: '--slots' + }, + { + label: '--no-warmup', + value: '--no-warmup' + }, + { + label: '--device', + value: '--device' + }, + { + label: '--gpu-layers', + value: '--gpu-layers' + }, + { + label: '--split-mode', + value: '--split-mode' + }, + { + label: '--tensor-split', + value: '--tensor-split' + }, + { + label: '--override-kv', + value: '--override-kv' + }, { label: '--chat-template', - value: '--chat-template' + value: '--chat-template', + options: [ + 'chatglm3', + 'chatglm4', + 'chatml', + 'command-r', + 'deepseek', + 'deepseek2', + 'deepseek3', + 'exaone3', + 'falcon', + 'falcon3', + 'gemma', + 'gigachat', + 'granite', + 'llama2', + 'llama2-sys', + 'llama2-sys-bos', + 'llama2-sys-strip', + 'llama3', + 'llava', + 'llava-mistral', + 'megrez', + 'minicpm', + 'mistral-v1', + 'mistral-v3', + 'mistral-v3-tekken', + 'mistral-v7', + 'monarch', + 'openchat', + 'orion', + 'phi3', + 'phi4', + 'rwkv-world', + 'vicuna', + 'vicuna-orca', + 'zephyr' + ] + }, + { + label: '--chat-template-file', + value: '--chat-template-file' + }, + { + label: '--slot-save-path', + value: '--slot-save-path' + }, + { + label: '--slot-prompt-similarity', + value: '--slot-prompt-similarity' + }, + { + label: '--tokens-per-second', + value: '--tokens-per-second' + }, + { + label: '--threads', + value: '--threads' + }, + { + label: '--cpu-mask', + value: '--cpu-mask' + }, + { + label: '--cpu-range', + value: '--cpu-range' + }, + { + label: '--cpu-strict', + value: '--cpu-strict', + options: ['0', '1'] + }, + { + label: '--prio', + value: '--prio', + options: ['0', '1', '2', '3'] + }, + { + label: '--poll', + value: '--poll' + }, + { + label: '--threads-batch', + value: '--threads-batch' + }, + { + label: '--cpu-mask-batch', + value: '--cpu-mask-batch' + }, + { + label: '--cpu-range-batch', + value: '--cpu-range-batch' + }, + { + label: '--cpu-strict-batch', + value: '--cpu-strict-batch', + options: ['0', '1'] + }, + { + label: '--prio-batch', + value: '--prio-batch', + options: ['0', '1', '2', '3'] + }, + { + label: '--poll-batch', + value: '--poll-batch' }, { label: '--ctx-size', @@ -9,8 +202,13 @@ const options = [ options: [] }, { - label: '--flash-attn', - value: '--flash-attn' + label: '--no-context-shift', + value: '--no-context-shift' + }, + { + label: '--predict', + value: '--predict', + options: ['-1', '-2'] }, { label: '--parallel', @@ -24,10 +222,240 @@ const options = [ label: '--ubatch-size', value: '--ubatch-size' }, + { + label: '--keep', + value: '--keep', + options: ['0', '-1'] + }, + { + label: '--escape', + value: '--escape' + }, + { + label: '--samplers', + value: '--samplers', + options: [] + }, + { + label: '--sampling-seq', + value: '--sampling-seq' + }, + { + label: '--temp', + value: '--temp' + }, + { + label: '--no-escape', + value: '--no-escape' + }, + { + label: '--top-k', + value: '--top-k' + }, + { + label: '--top-p', + value: '--top-p' + }, + { + label: '--min-p', + value: '--min-p' + }, + { + label: '--typical', + value: '--typical' + }, + { + label: '--xtc-probability', + value: '--xtc-probability' + }, + { + label: '--xtc-threshold', + value: '--xtc-threshold' + }, + { + label: '--repeat-last-n', + value: '--repeat-last-n' + }, + { + label: '--repeat-penalty', + value: '--repeat-penalty' + }, + { + label: '--presence-penalty', + value: '--presence-penalty' + }, + { + label: '--frequency-penalty', + value: '--frequency-penalty' + }, + { + label: '--dry-multiplier', + value: '--dry-multiplier' + }, + { + label: '--dry-base', + value: '--dry-base' + }, + { + label: '--dry-allowed-length', + value: '--dry-allowed-length' + }, + { + label: '--dry-penalty-last-n', + value: '--dry-penalty-last-n' + }, + { + label: '--dry-sequence-breaker', + value: '--dry-sequence-breaker' + }, + { + label: '--dynatemp-range', + value: '--dynatemp-range' + }, + { + label: '--dynatemp-exp', + value: '--dynatemp-exp' + }, + { + label: '--mirostat', + value: '--mirostat', + options: ['0', '1', '2'] + }, + { + label: '--mirostat-lr', + value: '--mirostat-lr' + }, + { + label: '--mirostat-ent', + value: '--mirostat-ent' + }, + { + label: '--logit-bias', + value: '--logit-bias' + }, + { + label: '--grammar', + value: '--grammar' + }, + { + label: '--grammar-file', + value: '--grammar-file' + }, + { + label: '--json-schema', + value: '--json-schema' + }, + { + label: '--rope-scaling', + value: '--rope-scaling', + options: ['none', 'linear', 'yarn'] + }, + { + label: '--rope-scale', + value: '--rope-scale' + }, + { + label: '--rope-freq-base', + value: '--rope-freq-base' + }, + { + label: '--rope-freq-scale', + value: '--rope-freq-scale' + }, + { + label: '--yarn-orig-ctx', + value: '--yarn-orig-ctx' + }, + { + label: '--yarn-ext-factor', + value: '--yarn-ext-factor' + }, + { + label: '--yarn-attn-factor', + value: '--yarn-attn-factor' + }, + { + label: '--yarn-beta-fast', + value: '--yarn-beta-fast' + }, + { + label: '--yarn-beta-slow', + value: '--yarn-beta-slow' + }, + { + label: '--no-kv-offload', + value: '--no-kv-offload' + }, + { + label: '--no-cache-prompt', + value: '--no-cache-prompt' + }, + { + label: '--cache-reuse', + value: '--cache-reuse' + }, + { + label: '--cache-type-k', + value: '--cache-type-k', + options: [ + 'f32', + 'f16', + 'bf16', + 'q8_0', + 'q4_0', + 'q4_1', + 'iq4_nl', + 'q5_0', + 'q5_1' + ] + }, + { + label: '--cache-type-v', + value: '--cache-type-v', + options: [ + 'f32', + 'f16', + 'bf16', + 'q8_0', + 'q4_0', + 'q4_1', + 'iq4_nl', + 'q5_0', + 'q5_1' + ] + }, + { + label: '--defrag-thold', + value: '--defrag-thold' + }, + { + label: '--no-cont-batching', + value: '--no-cont-batching' + }, + { + label: '--mlock', + value: '--mlock' + }, + { + label: '--no-mmap', + value: '--no-mmap' + }, + { + label: '--mmap', + value: '--mmap' + }, + { + label: '--visual-max-image-size', + value: '--visual-max-image-size' + }, { label: '--images', value: '--images' }, + { + label: '--model', + value: '--model' + }, { label: '--image-max-batch', value: '--image-max-batch' @@ -84,6 +512,18 @@ const options = [ label: '--image-slg-start', value: '--image-slg-end' }, + { + label: '--image-clip-l-model', + value: '--image-clip-l-model' + }, + { + label: '--image-clip-g-model', + value: '--image-clip-g-model' + }, + { + label: '--image-t5xxl-model', + value: '--image-t5xxl-model' + }, { label: '--image-schedule-method', value: '--image-schedule-method', @@ -93,6 +533,10 @@ const options = [ label: '--image-no-text-encoder-model-offload', value: '--image-no-text-encoder-model-offload' }, + { + label: '--image-vae-model', + value: '--image-vae-model' + }, { label: '--image-no-vae-model-offload', value: '--image-no-vae-model-offload' @@ -108,6 +552,38 @@ const options = [ { label: '--mmproj', value: '--mmproj' + }, + { + label: '--image-taesd-model', + value: '--image-taesd-model' + }, + { + label: '--image-upscale-model', + value: '--image-upscale-model' + }, + { + label: '--image-upscale-repeats', + value: '--image-upscale-repeats' + }, + { + label: '--image-no-control-net-model-offload', + value: '--image-no-control-net-model-offload' + }, + { + label: '--image-control-net-model', + value: '--image-control-net-model' + }, + { + label: '--image-control-strength', + value: '--image-control-strength' + }, + { + label: '--image-control-canny', + value: '--image-control-canny' + }, + { + label: '--image-free-compute-memory-immediately', + value: '--image-free-compute-memory-immediately' } ]; diff --git a/src/pages/playground/components/ground-images.tsx b/src/pages/playground/components/ground-images.tsx index 59007b28..2e81a4a6 100644 --- a/src/pages/playground/components/ground-images.tsx +++ b/src/pages/playground/components/ground-images.tsx @@ -68,7 +68,7 @@ const advancedFieldsDefaultValus = { sampling_steps: 10, negative_prompt: null, schedule_method: 'discrete', - preview: null + preview: 'preview_faster' }; const openaiCompatibleFieldsDefaultValus = { diff --git a/src/pages/playground/components/image-edit.tsx b/src/pages/playground/components/image-edit.tsx index 652c3ee5..e44a81e8 100644 --- a/src/pages/playground/components/image-edit.tsx +++ b/src/pages/playground/components/image-edit.tsx @@ -70,7 +70,7 @@ const advancedFieldsDefaultValus = { strength: 0.75, sampling_steps: 10, negative_prompt: null, - preview: null, + preview: 'preview_faster', schedule_method: 'discrete' }; diff --git a/src/pages/playground/config/params-config.ts b/src/pages/playground/config/params-config.ts index c524c98e..638780bf 100644 --- a/src/pages/playground/config/params-config.ts +++ b/src/pages/playground/config/params-config.ts @@ -311,7 +311,7 @@ export const ImageAdvancedParamsConfig: ParamsSchema[] = [ }, attrs: { min: 1.0, - max: 10, + max: 100, step: 0.1 }, rules: [ @@ -334,7 +334,7 @@ export const ImageAdvancedParamsConfig: ParamsSchema[] = [ }, attrs: { min: 1.0, - max: 10, + max: 100, step: 0.1 }, rules: [ diff --git a/src/pages/resources/config/index.ts b/src/pages/resources/config/index.ts index ba327328..68f2cdef 100644 --- a/src/pages/resources/config/index.ts +++ b/src/pages/resources/config/index.ts @@ -92,7 +92,7 @@ export const addWorkerGuide: Record = { }, container: { getToken: - 'docker run -it ${gpustack_container_id} cat /var/lib/gpustack/token' + 'docker exec -it ${gpustack_container_id} cat /var/lib/gpustack/token' } };