bug: Replicate example keeps waiting
abhinavkulkarni opened this issue · comments
Provide environment information
System:
OS: macOS 14.1.2
CPU: (8) arm64 Apple M1 Pro
Memory: 57.72 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.10.0 - /usr/local/bin/node
npm: 10.2.3 - /usr/local/bin/npm
Describe the bug
Hi,
I'm currently running the example provided at Replicate integration docs and the image generation task keeps waiting for the result even though I can see the generated result in Replicate dashboard.
![image](https://private-user-images.githubusercontent.com/1565547/303920824-676b8183-af39-4a23-9f95-b0b1f50a6a99.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxMjg2NTYsIm5iZiI6MTcyMjEyODM1NiwicGF0aCI6Ii8xNTY1NTQ3LzMwMzkyMDgyNC02NzZiODE4My1hZjM5LTRhMjMtOWY5NS1iMGIxZjUwYTZhOTkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjhUMDA1OTE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OThiYjA1MWUwMzNhZDRkZTRjMTU0Y2IzYmIxYjhlNmZjNzA3ODg4ZTg3YjRmMzdlMmM3YmZiYTNkYWQ5MjExZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.LXP9FirYppCFViOq9yorT5jZHBgUVSWxlMYyLF8uDkM)
Reproduction repo
https://trigger.dev/docs/integrations/apis/replicate#usage
To reproduce
I have written a simple job as follows:
import { eventTrigger } from "@trigger.dev/sdk";
import { Replicate } from "@trigger.dev/replicate";
import { client } from "@/trigger";
import z from "zod";
const replicate = new Replicate({
id: "replicate",
apiKey: process.env.REPLICATE_API_KEY!,
});
client.defineJob({
id: "replicate-create-prediction",
name: "Replicate - Create Prediction",
version: "0.1.0",
integrations: { replicate },
trigger: eventTrigger({
name: "replicate.predict",
schema: z.object({
prompt: z
.string()
.default("rick astley riding a harley through post-apocalyptic miami"),
version: z
.string()
.default("af1a68a271597604546c09c64aabcd7782c114a63539a4a8d14d1eeda5630c33"),
}),
}),
run: async (payload, io, ctx) => {
return io.replicate.predictions.createAndAwait("await-prediction", {
version: payload.version,
input: { prompt: payload.prompt },
});
},
});
Additional information
No response
I have the same issue. The run stops after a while and shows a disconnection error. I think it is because of the hobby plan. They will stop the run after 2-5 min.