Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Replicate example keeps waiting #897

Open
abhinavkulkarni opened this issue Feb 11, 2024 · 1 comment
Open

bug: Replicate example keeps waiting #897

abhinavkulkarni opened this issue Feb 11, 2024 · 1 comment

Comments

@abhinavkulkarni
Copy link

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

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

@abhinavkulkarni abhinavkulkarni changed the title [Bug] Replicate example keeps waiting bug: Replicate example keeps waiting Feb 11, 2024
@Kulaneian
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants