fix: calc log lines

This commit is contained in:
jialin
2025-01-10 15:41:01 +08:00
parent 5d903de2a2
commit 8282f48cdb
5 changed files with 47 additions and 36 deletions
@@ -412,7 +412,8 @@ const GroundLeft: React.FC<MessageProps> = forwardRef((props, ref) => {
padding: '8px 14px',
lineHeight: '20px',
display: 'flex',
justifyContent: 'center'
justifyContent: 'center',
wordBreak: 'break-word'
}}
>
{messageList.length ? (
@@ -36,7 +36,7 @@ const METAKEYS: Record<string, any> = {
top_p: 'top_p',
n_ctx: 'n_ctx',
n_slot: 'n_slot',
max_model_len: 'max_tokens'
max_model_len: 'max_model_len'
};
const ParamsSettings: React.FC<ParamsSettingsProps> = ({
@@ -114,18 +114,21 @@ const ParamsSettings: React.FC<ParamsSettingsProps> = ({
if (obj.n_ctx && obj.n_slot) {
defaultMaxTokens = _.divide(obj.n_ctx / 2, obj.n_slot);
} else if (obj.max_model_len) {
defaultMaxTokens = obj.max_model_len / 2;
}
form.setFieldsValue({
..._.omit(obj, ['n_ctx', 'n_slot']),
..._.omit(obj, ['n_ctx', 'n_slot', 'max_model_len']),
max_tokens: defaultMaxTokens
});
setMetaData({
...obj,
max_tokens: _.divide(obj.n_ctx, obj.n_slot)
max_tokens: obj.max_model_len || _.divide(obj.n_ctx, obj.n_slot)
});
return {
..._.omit(obj, ['n_ctx', 'n_slot']),
..._.omit(obj, ['n_ctx', 'n_slot', 'max_model_len']),
max_tokens: defaultMaxTokens
};
};