Kaynağa Gözat

feat: SSDESK适配修改

Hacked_v0.17.2
fellow99 7 ay önce
ebeveyn
işleme
0da53ce6cb

+ 5
- 4
Dockerfile Dosyayı Görüntüle

@@ -20,10 +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/BAAI/bge-reranker-v2-m3 \
/huggingface.co/maidalun1020/bce-embedding-base_v1 \
/huggingface.co/maidalun1020/bce-reranker-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 Dosyayı Görüntüle

@@ -312,6 +312,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
- 4
download_deps.py Dosyayı Görüntüle

@@ -28,10 +28,11 @@ repos = [
"InfiniFlow/text_concat_xgb_v1.0",
"InfiniFlow/deepdoc",
"InfiniFlow/huqie",
"BAAI/bge-large-zh-v1.5",
"BAAI/bge-reranker-v2-m3",
"maidalun1020/bce-embedding-base_v1",
"maidalun1020/bce-reranker-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):

+ 3
- 2
web/.umirc.ts Dosyayı Görüntüle

@@ -9,9 +9,9 @@ export default defineConfig({
outputPath: 'dist',
alias: { '@parent': path.resolve(__dirname, '../') },
npmClient: 'npm',
base: '/',
base: '/ss-ragflow/',
routes,
publicPath: '/',
publicPath: '/ss-ragflow/',
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 Dosyayı Görüntüle

@@ -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-ragflow/chat/share?shared_id=${token}&from=${form}&auth=${beta}`;
if (visibleAvatar) {
src += '&visible_avatar=1';
}

+ 1
- 1
web/src/components/api-service/hooks.ts Dosyayı Görüntüle

@@ -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-ragflow/chat/share?shared_id=${token}&from=${from}`;
};

const useFetchTokenListBeforeOtherStep = () => {

+ 1
- 1
web/src/pages/chat/shared-hooks.ts Dosyayı Görüntüle

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

+ 1
- 1
web/src/utils/api.ts Dosyayı Görüntüle

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

export { api_host };


Loading…
İptal
Kaydet