Commit bca4f71
authored
[Fix Replicate] Send
Fixing a bug introduced in
#1208 and more
precisely
[here](https://github.com/huggingface/huggingface.js/pull/1208/files#diff-ba5cb4afef57c85afde67b883b333c80972fc4ac5d3083d929447105ebfbe55fL107).
For Replicate provider, we must send `Prefer: wait` header as this is
the only path we support for now.
---
Tested locally and it fixes the textToVideo issue we have on
https://huggingface.co/Wan-AI/Wan2.1-T2V-14B
```ts
import { HfInference } from "@huggingface/inference";
import fs from "fs/promises";
async function generateTextToVideo() {
const hf = new HfInference("xxx");
const res = await hf.textToVideo({
inputs: "a cat swimming in an ocean of bananas",
provider: "replicate",
model: "Wan-AI/Wan2.1-T2V-14B",
});
const arrayBuffer = await res.arrayBuffer();
const buffer = Buffer.from(arrayBuffer);
await fs.writeFile("output.mp4", buffer);
}
generateTextToVideo();
```
https://github.com/user-attachments/assets/4234c65e-ab11-45e0-9e29-825f88b2be49
cc @SBrandeis @kefranabg @zekePrefer:wait header (#1249)1 parent 8b8c685 commit bca4f71
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
0 commit comments