浏览代码

feat: ss-rag适配修改

Hacked_v0.18.0
fellow99 6 个月前
父节点
当前提交
2589a302fb

+ 5
- 2
Dockerfile 查看文件

@@ -20,8 +20,11 @@ RUN --mount=type=bind,from=infiniflow/ragflow_deps:latest,source=/huggingface.co
RUN --mount=type=bind,from=infiniflow/ragflow_deps:latest,source=/huggingface.co,target=/huggingface.co \
if [ "$LIGHTEN" != "1" ]; then \
(tar -cf - \
/huggingface.co/BAAI/bge-large-zh-v1.5 \
/huggingface.co/maidalun1020/bce-embedding-base_v1 \
/huggingface.co/BAAI/bge-small-zh-v1.5 \
# /huggingface.co/BAAI/bge-large-zh-v1.5 \
# /huggingface.co/BAAI/bge-reranker-v2-m3 \
# /huggingface.co/maidalun1020/bce-embedding-base_v1 \
# /huggingface.co/maidalun1020/bce-reranker-base_v1 \
| tar -xf - --strip-components=2 -C /root/.ragflow) \
fi


+ 1
- 0
api/db/services/dialog_service.py 查看文件

@@ -399,6 +399,7 @@ def chat(dialog, messages, stream=True, **kwargs):
last_ans = ""
answer = ""
for ans in chat_mdl.chat_streamly(prompt + prompt4citation, msg[1:], gen_conf):
if ans == None: continue # SSDESK: 修复RKLLM返回信息没有终止符的问题
if thought:
ans = re.sub(r"<think>.*</think>", "", ans, flags=re.DOTALL)
answer = ans

+ 5
- 2
download_deps.py 查看文件

@@ -42,8 +42,11 @@ repos = [
"InfiniFlow/text_concat_xgb_v1.0",
"InfiniFlow/deepdoc",
"InfiniFlow/huqie",
"BAAI/bge-large-zh-v1.5",
"maidalun1020/bce-embedding-base_v1",
"BAAI/bge-small-zh-v1.5",
# "BAAI/bge-large-zh-v1.5",
# "BAAI/bge-reranker-v2-m3",
# "maidalun1020/bce-embedding-base_v1",
# "maidalun1020/bce-reranker-base_v1",
]

def download_model(repo_id):

+ 4
- 3
web/.umirc.ts 查看文件

@@ -6,12 +6,12 @@ import routes from './src/routes';

export default defineConfig({
title: appName,
outputPath: 'dist',
outputPath: 'dist/ss-rag',
alias: { '@parent': path.resolve(__dirname, '../') },
npmClient: 'npm',
base: '/',
base: '/ss-rag/',
routes,
publicPath: '/',
publicPath: '/ss-rag/',
esbuildMinifyIIFE: true,
icons: {},
hash: true,
@@ -20,6 +20,7 @@ export default defineConfig({
history: {
type: 'browser',
},
exportStatic: {},
plugins: [
'@react-dev-inspector/umi4-plugin',
'@umijs/plugins/dist/tailwindcss',

+ 1
- 1
web/src/components/api-service/embed-modal/index.tsx 查看文件

@@ -52,7 +52,7 @@ const EmbedModal = ({
}, []);

const generateIframeSrc = () => {
let src = `${location.origin}/chat/share?shared_id=${token}&from=${form}&auth=${beta}`;
let src = `${location.origin}/ss-rag/chat/share?shared_id=${token}&from=${form}&auth=${beta}`;
if (visibleAvatar) {
src += '&visible_avatar=1';
}

+ 1
- 1
web/src/components/api-service/hooks.ts 查看文件

@@ -82,7 +82,7 @@ export const useShowBetaEmptyError = () => {

const getUrlWithToken = (token: string, from: string = 'chat') => {
const { protocol, host } = window.location;
return `${protocol}//${host}/chat/share?shared_id=${token}&from=${from}`;
return `${protocol}//${host}/ss-rag/chat/share?shared_id=${token}&from=${from}`;
};

const useFetchTokenListBeforeOtherStep = () => {

+ 1
- 1
web/src/components/new-document-link.tsx 查看文件

@@ -25,7 +25,7 @@ const NewDocumentLink = ({
let nextLink = link;
const extension = getExtension(documentName);
if (!link) {
nextLink = `/document/${documentId}?ext=${extension}&prefix=${prefix}`;
nextLink = `/ss-rag/document/${documentId}?ext=${extension}&prefix=${prefix}`;
}

return (

+ 1
- 1
web/src/conf.json 查看文件

@@ -1,3 +1,3 @@
{
"appName": "RAGFlow"
"appName": "浩瀚知图"
}

+ 1
- 1
web/src/pages/chat/shared-hooks.ts 查看文件

@@ -50,7 +50,7 @@ export const useSendSharedMessage = () => {
useCreateNextSharedConversation();
const { handleInputChange, value, setValue } = useHandleMessageInputChange();
const { send, answer, done, stopOutputMessage } = useSendMessageWithSse(
`/api/v1/${from === SharedFrom.Agent ? 'agentbots' : 'chatbots'}/${conversationId}/completions`,
`/ss-rag-api/api/v1/${from === SharedFrom.Agent ? 'agentbots' : 'chatbots'}/${conversationId}/completions`,
);
const {
derivedMessages,

+ 1
- 1
web/src/utils/api.ts 查看文件

@@ -1,4 +1,4 @@
let api_host = `/v1`;
let api_host = `/ss-rag-api/v1`;

export { api_host };


+ 1
- 1
web/src/utils/authorization-util.ts 查看文件

@@ -59,5 +59,5 @@ export default storage;

// Will not jump to the login page
export function redirectToLogin() {
window.location.href = location.origin + `/login`;
window.location.href = location.origin + `/ss-rag/login`;
}

正在加载...
取消
保存