diff --git a/core/llm/llms/HuggingFaceInferenceAPI.ts b/core/llm/llms/HuggingFaceInferenceAPI.ts index d6de99445..9edb29568 100644 --- a/core/llm/llms/HuggingFaceInferenceAPI.ts +++ b/core/llm/llms/HuggingFaceInferenceAPI.ts @@ -13,7 +13,11 @@ class HuggingFaceInferenceAPI extends BaseLLM { options: CompletionOptions ): AsyncGenerator { const response = await this.fetch(`${this.apiBase}`, { - headers: { Authorization: `Bearer ${this.apiKey}` }, + headers: { + Authorization: `Bearer ${this.apiKey}`, + "Content-Type": "application/json", + Accept: "application/json", + }, method: "POST", body: JSON.stringify({ inputs: prompt,