Skip to content

Commit

Permalink
🐛 fix: fix HUGGINGFACE endpoint url
Browse files Browse the repository at this point in the history
  • Loading branch information
chai-mi committed Dec 20, 2024
1 parent eab067c commit e20cfcf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libs/agent-runtime/huggingface/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e20cfcf

Please sign in to comment.