🐛 add json headers to hf inference api
This commit is contained in:
parent
a4c643bb20
commit
ae71c83adc
1 changed files with 5 additions and 1 deletions
|
|
@ -13,7 +13,11 @@ class HuggingFaceInferenceAPI extends BaseLLM {
|
|||
options: CompletionOptions
|
||||
): AsyncGenerator<string> {
|
||||
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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue