Compare commits

..

6 Commits

Author SHA1 Message Date
josc146
14acfc1d81 release v1.7.2 2024-03-02 19:47:53 +08:00
josc146
2947162cc4 update defaultModelConfigs 2024-03-02 19:45:14 +08:00
josc146
4f14074a75 expose global_penalty 2024-03-02 17:50:41 +08:00
josc146
53a5574080 improve parameters controllable range 2024-03-02 16:52:53 +08:00
josc146
d91c3c004d allow setting tokenChunkSize of WebGPU mode 2024-03-02 16:41:29 +08:00
github-actions[bot]
c90cefc453 release v1.7.1 2024-03-01 08:03:52 +00:00
14 changed files with 154 additions and 79 deletions

View File

@@ -1,31 +1,17 @@
## Changes
**This version includes important bug fixes, it is strongly recommended to upgrade to this version.**
### Upgrades
- webgpu 0.3.20 https://github.com/cgisky1980/ai00_rwkv_server
### Features
- allow setting quantizedLayers of WebGPU mode
- allow setting tokenChunkSize of WebGPU mode
- expose global_penalty
### Improvements
- improve occurrence[token] condition
- disable AVOID_PENALTY_TOKENS when generating (still enabled when preprocessing)
- enable useHfMirror by default for chinese users
### Fixes
- fix the issue where state cache could be modified leading to inconsistent hit results
- fix convert_safetensors.py for rwkv6
- add python3-dev to lora fine-tune dependencies (this may previously lead to the error of v5 fine-tune)
- improve parameters controllable range
### Chores
- hide MPS and CUDA-Beta Options
- update manifest
- update defaultModelConfigs
## Install

View File

@@ -26,12 +26,19 @@ class RWKV:
if s.startswith("layer")
)
chunk_size = (
int(s.lstrip("chunk"))
for s in strategy.split()
for s in s.split(",")
if s.startswith("chunk")
)
args = {
"file": model_path,
"turbo": True,
"quant": next(layer, 31) if "i8" in strategy else 0,
"quant_nf4": next(layer, 26) if "i4" in strategy else 0,
"token_chunk_size": 128,
"token_chunk_size": next(chunk_size, 32),
"lora": None,
}
self.model = self.wrp.Model(**args)

View File

@@ -40,6 +40,7 @@ class AbstractRWKV(ABC):
self.penalty_alpha_presence = 0
self.penalty_alpha_frequency = 1
self.penalty_decay = 0.996
self.global_penalty = False
@abstractmethod
def adjust_occurrence(self, occurrence: Dict, token: int):
@@ -403,8 +404,8 @@ class TextRWKV(AbstractRWKV):
+ occurrence[n] * self.penalty_alpha_frequency
)
# comment the codes below to get the same generated results as the official RWKV Gradio
if i == 0:
# set global_penalty to False to get the same generated results as the official RWKV Gradio
if self.global_penalty and i == 0:
for token in self.model_tokens:
token = int(token)
if token not in self.AVOID_PENALTY_TOKENS:
@@ -667,12 +668,13 @@ def RWKV(model: str, strategy: str, tokenizer: Union[str, None]) -> AbstractRWKV
class ModelConfigBody(BaseModel):
max_tokens: int = Field(default=None, gt=0, le=102400)
temperature: float = Field(default=None, ge=0, le=2)
temperature: float = Field(default=None, ge=0, le=3)
top_p: float = Field(default=None, ge=0, le=1)
presence_penalty: float = Field(default=None, ge=-2, le=2)
frequency_penalty: float = Field(default=None, ge=-2, le=2)
penalty_decay: float = Field(default=None, ge=0.99, le=0.999)
top_k: int = Field(default=None, ge=0, le=25)
global_penalty: bool = Field(default=None)
model_config = {
"json_schema_extra": {
@@ -683,6 +685,7 @@ class ModelConfigBody(BaseModel):
"presence_penalty": 0,
"frequency_penalty": 1,
"penalty_decay": 0.996,
"global_penalty": False,
}
}
}
@@ -706,6 +709,8 @@ def set_rwkv_config(model: AbstractRWKV, body: ModelConfigBody):
model.penalty_decay = body.penalty_decay
if body.top_k is not None:
model.top_k = body.top_k
if body.global_penalty is not None:
model.global_penalty = body.global_penalty
def get_rwkv_config(model: AbstractRWKV) -> ModelConfigBody:
@@ -717,4 +722,5 @@ def get_rwkv_config(model: AbstractRWKV) -> ModelConfigBody:
frequency_penalty=model.penalty_alpha_frequency,
penalty_decay=model.penalty_decay,
top_k=model.top_k,
global_penalty=model.global_penalty,
)

View File

@@ -343,5 +343,9 @@
"History Message Number": "履歴メッセージ数",
"Send All Message": "すべてのメッセージを送信",
"Quantized Layers": "量子化されたレイヤー",
"Number of the neural network layers quantized with current precision, the more you quantize, the lower the VRAM usage, but the quality correspondingly decreases.": "現在の精度で量子化されたニューラルネットワークのレイヤーの数、量子化するほどVRAMの使用量が低くなりますが、品質も相応に低下します。"
"Number of the neural network layers quantized with current precision, the more you quantize, the lower the VRAM usage, but the quality correspondingly decreases.": "現在の精度で量子化されたニューラルネットワークのレイヤーの数、量子化するほどVRAMの使用量が低くなりますが、品質も相応に低下します。",
"Parallel Token Chunk Size": "並列トークンチャンクサイズ",
"Maximum tokens to be processed in parallel at once. For high end GPUs, this could be 64 or 128 (faster).": "一度に並列で処理される最大トークン数。高性能なGPUの場合、64または128になります高速。",
"Global Penalty": "グローバルペナルティ",
"When generating a response, whether to include the submitted prompt as a penalty factor. By turning this off, you will get the same generated results as official RWKV Gradio. If you find duplicate results in the generated results, turning this on can help avoid generating duplicates.": "レスポンスを生成する際、提出されたプロンプトをペナルティ要因として含めるかどうか。これをオフにすると、公式RWKV Gradioと同じ生成結果を得ることができます。生成された結果に重複がある場合、これをオンにすることで重複の生成を回避するのに役立ちます。"
}

View File

@@ -343,5 +343,9 @@
"History Message Number": "历史消息数量",
"Send All Message": "发送所有消息",
"Quantized Layers": "量化层数",
"Number of the neural network layers quantized with current precision, the more you quantize, the lower the VRAM usage, but the quality correspondingly decreases.": "神经网络以当前精度量化的层数, 量化越多, 占用显存越低, 但质量相应下降"
"Number of the neural network layers quantized with current precision, the more you quantize, the lower the VRAM usage, but the quality correspondingly decreases.": "神经网络以当前精度量化的层数, 量化越多, 占用显存越低, 但质量相应下降",
"Parallel Token Chunk Size": "并行Token块大小",
"Maximum tokens to be processed in parallel at once. For high end GPUs, this could be 64 or 128 (faster).": "一次最多可以并行处理的token数量. 对于高端显卡, 这可以是64或128 (更快)",
"Global Penalty": "全局惩罚",
"When generating a response, whether to include the submitted prompt as a penalty factor. By turning this off, you will get the same generated results as official RWKV Gradio. If you find duplicate results in the generated results, turning this on can help avoid generating duplicates.": "生成响应时, 是否将提交的prompt也纳入到惩罚项. 关闭此项将得到与RWKV官方Gradio完全一致的生成结果. 如果你发现生成结果出现重复, 那么开启此项有助于避免生成重复"
}

View File

@@ -247,7 +247,7 @@ const SidePanel: FC = observer(() => {
<Labeled flex breakline label={t('Temperature')}
desc={t('Sampling temperature, it\'s like giving alcohol to a model, the higher the stronger the randomness and creativity, while the lower, the more focused and deterministic it will be.')}
content={
<ValuedSlider value={params.temperature} min={0} max={2} step={0.1}
<ValuedSlider value={params.temperature} min={0} max={3} step={0.1}
input
onChange={(e, data) => {
commonStore.setChatParams({
@@ -258,7 +258,7 @@ const SidePanel: FC = observer(() => {
<Labeled flex breakline label={t('Top_P')}
desc={t('Just like feeding sedatives to the model. Consider the results of the top n% probability mass, 0.1 considers the top 10%, with higher quality but more conservative, 1 considers all results, with lower quality but more diverse.')}
content={
<ValuedSlider value={params.topP} min={0} max={1} step={0.1} input
<ValuedSlider value={params.topP} min={0} max={1} step={0.05} input
onChange={(e, data) => {
commonStore.setChatParams({
topP: data.value

View File

@@ -188,7 +188,7 @@ const CompletionPanel: FC = observer(() => {
<Labeled flex breakline label={t('Temperature')}
desc={t('Sampling temperature, it\'s like giving alcohol to a model, the higher the stronger the randomness and creativity, while the lower, the more focused and deterministic it will be.')}
content={
<ValuedSlider value={params.temperature} min={0} max={2} step={0.1}
<ValuedSlider value={params.temperature} min={0} max={3} step={0.1}
input
onChange={(e, data) => {
setParams({
@@ -199,7 +199,7 @@ const CompletionPanel: FC = observer(() => {
<Labeled flex breakline label={t('Top_P')}
desc={t('Just like feeding sedatives to the model. Consider the results of the top n% probability mass, 0.1 considers the top 10%, with higher quality but more conservative, 1 considers all results, with lower quality but more diverse.')}
content={
<ValuedSlider value={params.topP} min={0} max={1} step={0.1} input
<ValuedSlider value={params.topP} min={0} max={1} step={0.05} input
onChange={(e, data) => {
setParams({
topP: data.value

View File

@@ -275,7 +275,7 @@ const CompositionPanel: FC = observer(() => {
<Labeled flex breakline label={t('Temperature')}
desc={t('Sampling temperature, it\'s like giving alcohol to a model, the higher the stronger the randomness and creativity, while the lower, the more focused and deterministic it will be.')}
content={
<ValuedSlider value={params.temperature} min={0} max={2} step={0.1}
<ValuedSlider value={params.temperature} min={0} max={3} step={0.1}
input
onChange={(e, data) => {
setParams({
@@ -286,7 +286,7 @@ const CompositionPanel: FC = observer(() => {
<Labeled flex breakline label={t('Top_P')}
desc={t('Just like feeding sedatives to the model. Consider the results of the top n% probability mass, 0.1 considers the top 10%, with higher quality but more conservative, 1 considers all results, with lower quality but more diverse.')}
content={
<ValuedSlider value={params.topP} min={0} max={1} step={0.1} input
<ValuedSlider value={params.topP} min={0} max={1} step={0.05} input
onChange={(e, data) => {
setParams({
topP: data.value

View File

@@ -35,6 +35,7 @@ import { ResetConfigsButton } from '../components/ResetConfigsButton';
import { useMediaQuery } from 'usehooks-ts';
import { ApiParameters, Device, ModelParameters, Precision } from '../types/configs';
import { convertModel, convertToGGML, convertToSt } from '../utils/convert-model';
import { defaultPenaltyDecay } from './defaultConfigs';
const ConfigSelector: FC<{
selectedIndex: number,
@@ -66,14 +67,17 @@ const Configs: FC = observer(() => {
const [selectedIndex, setSelectedIndex] = React.useState(commonStore.currentModelConfigIndex);
const [selectedConfig, setSelectedConfig] = React.useState(commonStore.modelConfigs[selectedIndex]);
const [displayStrategyImg, setDisplayStrategyImg] = React.useState(false);
const advancedHeaderRef = useRef<HTMLDivElement>(null);
const advancedHeaderRef1 = useRef<HTMLDivElement>(null);
const advancedHeaderRef2 = useRef<HTMLDivElement>(null);
const mq = useMediaQuery('(min-width: 640px)');
const navigate = useNavigate();
const port = selectedConfig.apiParameters.apiPort;
useEffect(() => {
if (advancedHeaderRef.current)
(advancedHeaderRef.current.firstElementChild as HTMLElement).style.padding = '0';
if (advancedHeaderRef1.current)
(advancedHeaderRef1.current.firstElementChild as HTMLElement).style.padding = '0';
if (advancedHeaderRef2.current)
(advancedHeaderRef2.current.firstElementChild as HTMLElement).style.padding = '0';
}, []);
const updateSelectedIndex = useCallback((newIndex: number) => {
@@ -113,7 +117,9 @@ const Configs: FC = observer(() => {
temperature: selectedConfig.apiParameters.temperature,
top_p: selectedConfig.apiParameters.topP,
presence_penalty: selectedConfig.apiParameters.presencePenalty,
frequency_penalty: selectedConfig.apiParameters.frequencyPenalty
frequency_penalty: selectedConfig.apiParameters.frequencyPenalty,
penalty_decay: selectedConfig.apiParameters.penaltyDecay,
global_penalty: selectedConfig.apiParameters.globalPenalty
});
toast(t('Config Saved'), { autoClose: 300, type: 'success' });
};
@@ -176,7 +182,7 @@ const Configs: FC = observer(() => {
<Labeled label={t('Temperature') + ' *'}
desc={t('Sampling temperature, it\'s like giving alcohol to a model, the higher the stronger the randomness and creativity, while the lower, the more focused and deterministic it will be.')}
content={
<ValuedSlider value={selectedConfig.apiParameters.temperature} min={0} max={2} step={0.1}
<ValuedSlider value={selectedConfig.apiParameters.temperature} min={0} max={3} step={0.1}
input
onChange={(e, data) => {
setSelectedConfigApiParams({
@@ -187,13 +193,23 @@ const Configs: FC = observer(() => {
<Labeled label={t('Top_P') + ' *'}
desc={t('Just like feeding sedatives to the model. Consider the results of the top n% probability mass, 0.1 considers the top 10%, with higher quality but more conservative, 1 considers all results, with lower quality but more diverse.')}
content={
<ValuedSlider value={selectedConfig.apiParameters.topP} min={0} max={1} step={0.1} input
<ValuedSlider value={selectedConfig.apiParameters.topP} min={0} max={1} step={0.05} input
onChange={(e, data) => {
setSelectedConfigApiParams({
topP: data.value
});
}} />
} />
<Accordion className="sm:col-span-2" collapsible
openItems={!commonStore.apiParamsCollapsed && 'advanced'}
onToggle={(e, data) => {
if (data.value === 'advanced')
commonStore.setApiParamsCollapsed(!commonStore.apiParamsCollapsed);
}}>
<AccordionItem value="advanced">
<AccordionHeader ref={advancedHeaderRef1} size="small">{t('Advanced')}</AccordionHeader>
<AccordionPanel>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-2">
<Labeled label={t('Presence Penalty') + ' *'}
desc={t('Positive values penalize new tokens based on whether they appear in the text so far, increasing the model\'s likelihood to talk about new topics.')}
content={
@@ -216,6 +232,35 @@ const Configs: FC = observer(() => {
});
}} />
} />
<Labeled
label={t('Penalty Decay')
+ ((!selectedConfig.apiParameters.penaltyDecay || selectedConfig.apiParameters.penaltyDecay === defaultPenaltyDecay)
? ` (${t('Default')})` : '')
+ ' *'}
desc={t('If you don\'t know what it is, keep it default.')}
content={
<ValuedSlider value={selectedConfig.apiParameters.penaltyDecay || defaultPenaltyDecay}
min={0.99} max={0.999} step={0.001} toFixed={3} input
onChange={(e, data) => {
setSelectedConfigApiParams({
penaltyDecay: data.value
});
}} />
} />
<Labeled label={t('Global Penalty') + ' *'}
desc={t('When generating a response, whether to include the submitted prompt as a penalty factor. By turning this off, you will get the same generated results as official RWKV Gradio. If you find duplicate results in the generated results, turning this on can help avoid generating duplicates.')}
content={
<Switch checked={selectedConfig.apiParameters.globalPenalty}
onChange={(e, data) => {
setSelectedConfigApiParams({
globalPenalty: data.checked
});
}} />
} />
</div>
</AccordionPanel>
</AccordionItem>
</Accordion>
</div>
}
/>
@@ -331,7 +376,21 @@ const Configs: FC = observer(() => {
}} />
} />
}
{selectedConfig.modelParameters.device.startsWith('WebGPU') && <div />}
{
selectedConfig.modelParameters.device.startsWith('WebGPU') &&
<Labeled label={t('Parallel Token Chunk Size')}
desc={t('Maximum tokens to be processed in parallel at once. For high end GPUs, this could be 64 or 128 (faster).')}
content={
<ValuedSlider
value={selectedConfig.modelParameters.tokenChunkSize || 32}
min={16} max={256} step={16} input
onChange={(e, data) => {
setSelectedConfigModelParams({
tokenChunkSize: data.value
});
}} />
} />
}
{
selectedConfig.modelParameters.device.startsWith('WebGPU') &&
<Labeled label={t('Quantized Layers')}
@@ -396,7 +455,7 @@ const Configs: FC = observer(() => {
commonStore.setModelParamsCollapsed(!commonStore.modelParamsCollapsed);
}}>
<AccordionItem value="advanced">
<AccordionHeader ref={advancedHeaderRef} size="small">{t('Advanced')}</AccordionHeader>
<AccordionHeader ref={advancedHeaderRef2} size="small">{t('Advanced')}</AccordionHeader>
<AccordionPanel>
<div className="flex flex-col">
<div className="flex grow">

View File

@@ -207,7 +207,7 @@ export const defaultModelConfigsMac: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-5-World-1B5-v2-20231025-ctx4096.pth',
modelName: 'RWKV-x060-World-1B6-v2-20240208-ctx4096.pth',
device: 'WebGPU',
precision: 'nf4',
storedLayers: 41,
@@ -225,7 +225,7 @@ export const defaultModelConfigsMac: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
modelName: 'RWKV-x060-World-3B-v2-20240228-ctx4096.pth',
device: 'WebGPU',
precision: 'nf4',
storedLayers: 41,
@@ -243,7 +243,7 @@ export const defaultModelConfigsMac: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth',
modelName: 'RWKV-x060-World-3B-v2-20240228-ctx4096.pth',
device: 'WebGPU',
precision: 'nf4',
storedLayers: 41,
@@ -333,7 +333,7 @@ export const defaultModelConfigsMac: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-5-World-1B5-v2-20231025-ctx4096.pth',
modelName: 'RWKV-x060-World-1B6-v2-20240208-ctx4096.pth',
device: 'MPS',
precision: 'fp32',
storedLayers: 41,
@@ -352,7 +352,7 @@ export const defaultModelConfigsMac: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
modelName: 'RWKV-x060-World-3B-v2-20240228-ctx4096.pth',
device: 'MPS',
precision: 'fp32',
storedLayers: 41,
@@ -371,7 +371,7 @@ export const defaultModelConfigsMac: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth',
modelName: 'RWKV-x060-World-3B-v2-20240228-ctx4096.pth',
device: 'MPS',
precision: 'fp32',
storedLayers: 41,
@@ -412,7 +412,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-5-World-1B5-v2-20231025-ctx4096.pth',
modelName: 'RWKV-x060-World-1B6-v2-20240208-ctx4096.pth',
device: 'CUDA',
precision: 'int8',
storedLayers: 41,
@@ -431,7 +431,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
modelName: 'RWKV-x060-World-3B-v2-20240228-ctx4096.pth',
device: 'CUDA',
precision: 'int8',
storedLayers: 6,
@@ -450,7 +450,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-5-World-1B5-v2-20231025-ctx4096.pth',
modelName: 'RWKV-x060-World-1B6-v2-20240208-ctx4096.pth',
device: 'CUDA',
precision: 'fp16',
storedLayers: 41,
@@ -469,7 +469,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
modelName: 'RWKV-x060-World-3B-v2-20240228-ctx4096.pth',
device: 'CUDA',
precision: 'int8',
storedLayers: 24,
@@ -488,7 +488,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth',
modelName: 'RWKV-x060-World-3B-v2-20240228-ctx4096.pth',
device: 'CUDA',
precision: 'int8',
storedLayers: 24,
@@ -545,7 +545,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
modelName: 'RWKV-x060-World-3B-v2-20240228-ctx4096.pth',
device: 'CUDA',
precision: 'int8',
storedLayers: 41,
@@ -564,7 +564,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth',
modelName: 'RWKV-x060-World-3B-v2-20240228-ctx4096.pth',
device: 'CUDA',
precision: 'int8',
storedLayers: 41,
@@ -621,7 +621,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
modelName: 'RWKV-x060-World-3B-v2-20240228-ctx4096.pth',
device: 'CUDA',
precision: 'fp16',
storedLayers: 41,
@@ -640,7 +640,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth',
modelName: 'RWKV-x060-World-3B-v2-20240228-ctx4096.pth',
device: 'CUDA',
precision: 'fp16',
storedLayers: 41,
@@ -809,7 +809,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-5-World-1B5-v2-20231025-ctx4096.pth',
modelName: 'RWKV-x060-World-1B6-v2-20240208-ctx4096.pth',
device: 'WebGPU',
precision: 'nf4',
storedLayers: 41,
@@ -827,7 +827,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-5-World-3B-v2-20231118-ctx16k.pth',
modelName: 'RWKV-x060-World-3B-v2-20240228-ctx4096.pth',
device: 'WebGPU',
precision: 'nf4',
storedLayers: 41,
@@ -845,7 +845,7 @@ export const defaultModelConfigs: ModelConfig[] = [
frequencyPenalty: 1
},
modelParameters: {
modelName: 'RWKV-4-World-CHNtuned-3B-v1-20230625-ctx4096.pth',
modelName: 'RWKV-x060-World-3B-v2-20240228-ctx4096.pth',
device: 'WebGPU',
precision: 'nf4',
storedLayers: 41,

View File

@@ -127,6 +127,7 @@ class CommonStore {
// configs
currentModelConfigIndex: number = 0;
modelConfigs: ModelConfig[] = [];
apiParamsCollapsed: boolean = true;
modelParamsCollapsed: boolean = true;
// models
activeModelListTags: string[] = [];
@@ -324,6 +325,10 @@ class CommonStore {
this.advancedCollapsed = value;
}
setApiParamsCollapsed(value: boolean) {
this.apiParamsCollapsed = value;
}
setModelParamsCollapsed(value: boolean) {
this.modelParamsCollapsed = value;
}

View File

@@ -6,6 +6,7 @@ export type ApiParameters = {
presencePenalty: number;
frequencyPenalty: number;
penaltyDecay?: number;
globalPenalty?: boolean;
}
export type Device = 'CPU' | 'CPU (rwkv.cpp)' | 'CUDA' | 'CUDA-Beta' | 'WebGPU' | 'WebGPU (Python)' | 'MPS' | 'Custom';
export type Precision = 'fp16' | 'int8' | 'fp32' | 'nf4' | 'Q5_1';
@@ -17,6 +18,7 @@ export type ModelParameters = {
storedLayers: number;
maxStoredLayers: number;
quantizedLayers?: number;
tokenChunkSize?: number;
useCustomCuda?: boolean;
customStrategy?: string;
useCustomTokenizer?: boolean;

View File

@@ -196,6 +196,8 @@ export const getStrategy = (modelConfig: ModelConfig | undefined = undefined) =>
strategy += params.precision === 'nf4' ? 'fp16i4' : params.precision === 'int8' ? 'fp16i8' : 'fp16';
if (params.quantizedLayers)
strategy += ` layer${params.quantizedLayers}`;
if (params.tokenChunkSize)
strategy += ` chunk${params.tokenChunkSize}`;
break;
case 'CUDA':
case 'CUDA-Beta':

View File

@@ -1,5 +1,5 @@
{
"version": "1.7.0",
"version": "1.7.1",
"introduction": {
"en": "RWKV is an open-source, commercially usable large language model with high flexibility and great potential for development.\n### About This Tool\nThis tool aims to lower the barrier of entry for using large language models, making it accessible to everyone. It provides fully automated dependency and model management. You simply need to click and run, following the instructions, to deploy a local large language model. The tool itself is very compact and only requires a single executable file for one-click deployment.\nAdditionally, this tool offers an interface that is fully compatible with the OpenAI API. This means you can use any ChatGPT client as a client for RWKV, enabling capability expansion beyond just chat functionality.\n### Preset Configuration Rules at the Bottom\nThis tool comes with a series of preset configurations to reduce complexity. The naming rules for each configuration represent the following in order: device - required VRAM/memory - model size - model language.\nFor example, \"GPU-8G-3B-EN\" indicates that this configuration is for a graphics card with 8GB of VRAM, a model size of 3 billion parameters, and it uses an English language model.\nLarger model sizes have higher performance and VRAM requirements. Among configurations with the same model size, those with higher VRAM usage will have faster runtime.\nFor example, if you have 12GB of VRAM but running the \"GPU-12G-7B-EN\" configuration is slow, you can downgrade to \"GPU-8G-3B-EN\" for a significant speed improvement.\n### About RWKV\nRWKV is an RNN with Transformer-level LLM performance, which can also be directly trained like a GPT transformer (parallelizable). And it's 100% attention-free. You only need the hidden state at position t to compute the state at position t+1. You can use the \"GPT\" mode to quickly compute the hidden state for the \"RNN\" mode.<br/>So it's combining the best of RNN and transformer - great performance, fast inference, saves VRAM, fast training, \"infinite\" ctx_len, and free sentence embedding (using the final hidden state).",
"zh": "RWKV是一个开源且允许商用的大语言模型灵活性很高且极具发展潜力。\n### 关于本工具\n本工具旨在降低大语言模型的使用门槛做到人人可用本工具提供了全自动化的依赖和模型管理你只需要直接点击运行跟随引导即可完成本地大语言模型的部署工具本身体积极小只需要一个exe即可完成一键部署。\n此外本工具提供了与OpenAI API完全兼容的接口这意味着你可以把任意ChatGPT客户端用作RWKV的客户端实现能力拓展而不局限于聊天。\n### 底部的预设配置规则\n本工具内置了一系列预设配置以降低使用难度每个配置名的规则依次代表着设备-所需显存/内存-模型规模-模型语言。\n例如GPU-8G-3B-CN表示该配置用于显卡需要8G显存模型规模为30亿参数使用的是中文模型。\n模型规模越大性能要求越高显存要求也越高而同样模型规模的配置中显存占用越高的运行速度越快。\n例如当你有12G显存但运行GPU-12G-7B-CN配置速度比较慢可降级成GPU-8G-3B-CN将会大幅提速。\n### 关于RWKV\nRWKV是具有Transformer级别LLM性能的RNN也可以像GPT Transformer一样直接进行训练可并行化。而且它是100% attention-free的。你只需在位置t处获得隐藏状态即可计算位置t + 1处的状态。你可以使用“GPT”模式快速计算用于“RNN”模式的隐藏状态。\n因此它将RNN和Transformer的优点结合起来 - 高性能、快速推理、节省显存、快速训练、“无限”上下文长度以及免费的语句嵌入(使用最终隐藏状态)。"