From 32dcb7b168e0f2f5f2f14e9f85caaf70bace79c7 Mon Sep 17 00:00:00 2001 From: mizy <1060950782@163.com> Date: Wed, 17 Jan 2024 17:36:48 +0800 Subject: [PATCH] fix: bug --- app/pages/Import/AIImport/Create.tsx | 4 ++-- package-lock.json | 14 +++++++------- package.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/pages/Import/AIImport/Create.tsx b/app/pages/Import/AIImport/Create.tsx index 2f29bdae..accb424f 100644 --- a/app/pages/Import/AIImport/Create.tsx +++ b/app/pages/Import/AIImport/Create.tsx @@ -53,12 +53,12 @@ const Create = observer((props: { visible: boolean; onCancel: () => void }) => { const type = types[subfix] || 1; const size = file.size * type; const schema = await llm.getSpaceSchema(space); - const schemaBytesLength = getByteLength(schema) + 500; //prompt length about 500 + const schemaBytesLength = getByteLength(schema) + 1000; //prompt length about 500 const splitNums = Math.ceil(size / llm.config.maxContextLength); const splitBytesLength = Math.ceil(schemaBytesLength * splitNums); const totalBytesLength = splitBytesLength + file.size; // full connection - const tokensNum = totalBytesLength / 4; //about 4 bytes per token + const tokensNum = totalBytesLength / 2; //about 4 bytes per token setTokens(tokensNum); } })(); diff --git a/package-lock.json b/package-lock.json index e993df58..90550699 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@vesoft-inc/force-graph": "2.0.7", "@vesoft-inc/i18n": "^1.0.1", "@vesoft-inc/icons": "^1.7.0", - "@vesoft-inc/nebula-explain-graph": "^1.0.6", + "@vesoft-inc/nebula-explain-graph": "^1.0.11", "@vesoft-inc/veditor": "^4.4.14", "antd": "^5.8.4", "axios": "^0.23.0", @@ -2063,9 +2063,9 @@ "integrity": "sha512-862wYZP+oueH7WqykjV9xMqOP9lYQajqdrGjhTT18C57Y0g7HFikzrujArSk9q63qdo8viNO/27hl1iKULH4bQ==" }, "node_modules/@vesoft-inc/nebula-explain-graph": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@vesoft-inc/nebula-explain-graph/-/nebula-explain-graph-1.0.6.tgz", - "integrity": "sha512-4sv0lDI4eC162T+TkZMkNV9rVgxpdZ/U3RCm9NhxTDGGxhbU+6uzi3CWjjmp/WTRPr6StZXBgpP7ORBkVorVfg==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@vesoft-inc/nebula-explain-graph/-/nebula-explain-graph-1.0.11.tgz", + "integrity": "sha512-4HVfdtXU8qtqZEwB/Cdnmzqa3ntHUPdFh1rTUBLaiwxV7UdITto+K3gJFAqv34EdCukzZOr+DwZCXyu5IanDDg==", "peerDependencies": { "@vesoft-inc/veditor": "^4.4.13", "antd": "^4||^5", @@ -10500,9 +10500,9 @@ "integrity": "sha512-862wYZP+oueH7WqykjV9xMqOP9lYQajqdrGjhTT18C57Y0g7HFikzrujArSk9q63qdo8viNO/27hl1iKULH4bQ==" }, "@vesoft-inc/nebula-explain-graph": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@vesoft-inc/nebula-explain-graph/-/nebula-explain-graph-1.0.6.tgz", - "integrity": "sha512-4sv0lDI4eC162T+TkZMkNV9rVgxpdZ/U3RCm9NhxTDGGxhbU+6uzi3CWjjmp/WTRPr6StZXBgpP7ORBkVorVfg==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@vesoft-inc/nebula-explain-graph/-/nebula-explain-graph-1.0.11.tgz", + "integrity": "sha512-4HVfdtXU8qtqZEwB/Cdnmzqa3ntHUPdFh1rTUBLaiwxV7UdITto+K3gJFAqv34EdCukzZOr+DwZCXyu5IanDDg==", "requires": {} }, "@vesoft-inc/veditor": { diff --git a/package.json b/package.json index afe0195f..bcf8d080 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@vesoft-inc/force-graph": "2.0.7", "@vesoft-inc/i18n": "^1.0.1", "@vesoft-inc/icons": "^1.7.0", - "@vesoft-inc/nebula-explain-graph": "^1.0.10", + "@vesoft-inc/nebula-explain-graph": "^1.0.11", "@vesoft-inc/veditor": "^4.4.14", "antd": "^5.8.4", "axios": "^0.23.0",