From e20cfcf1ef16f9ce4174f7ad2440e0498e45d722 Mon Sep 17 00:00:00 2001 From: chai-mi <107172917+chai-mi@users.noreply.github.com> Date: Fri, 20 Dec 2024 20:44:50 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20fix=20HUGGINGFACE=20endpo?= =?UTF-8?q?int=20url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libs/agent-runtime/huggingface/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/agent-runtime/huggingface/index.ts b/src/libs/agent-runtime/huggingface/index.ts index b31a12b1af276..dab9dafbe7f40 100644 --- a/src/libs/agent-runtime/huggingface/index.ts +++ b/src/libs/agent-runtime/huggingface/index.ts @@ -23,7 +23,9 @@ export const LobeHuggingFaceAI = LobeOpenAICompatibleFactory({ createChatCompletionStream: (client: HfInference, payload, instance) => { const { max_tokens = 4096} = payload; const hfRes = client.chatCompletionStream({ - endpointUrl: instance.baseURL, + endpointUrl: instance.baseURL + ? new URL(payload.model, instance.baseURL).toString() + : instance.baseURL, max_tokens: max_tokens, messages: payload.messages, model: payload.model,