Skip to content

Commit

Permalink
🐛 fix: fix HUGGINGFACE endpoint url (lobehub#5099)
Browse files Browse the repository at this point in the history
  • Loading branch information
chai-mi authored Dec 21, 2024
1 parent 8e13ec2 commit abc80dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libs/agent-runtime/huggingface/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { HfInference } from '@huggingface/inference';
import urlJoin from 'url-join';

import { AgentRuntimeErrorType } from '../error';
import { ModelProvider } from '../types';
Expand All @@ -23,7 +24,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
? urlJoin(instance.baseURL, payload.model)
: instance.baseURL,
max_tokens: max_tokens,
messages: payload.messages,
model: payload.model,
Expand Down

0 comments on commit abc80dc

Please sign in to comment.