diff --git a/core/llm/llms/HuggingFaceInferenceAPI.ts b/core/llm/llms/HuggingFaceInferenceAPI.ts index ba6286b95..d6de99445 100644 --- a/core/llm/llms/HuggingFaceInferenceAPI.ts +++ b/core/llm/llms/HuggingFaceInferenceAPI.ts @@ -12,17 +12,14 @@ class HuggingFaceInferenceAPI extends BaseLLM { prompt: string, options: CompletionOptions ): AsyncGenerator { - const response = await this.fetch( - `${this.apiBase}/models/${options.model}`, - { - headers: { Authorization: `Bearer ${this.apiKey}` }, - method: "POST", - body: JSON.stringify({ - inputs: prompt, - stream: true, - }), - } - ); + const response = await this.fetch(`${this.apiBase}`, { + headers: { Authorization: `Bearer ${this.apiKey}` }, + method: "POST", + body: JSON.stringify({ + inputs: prompt, + stream: true, + }), + }); for await (const chunk of streamResponse(response)) { yield chunk; }