replicate/replicate-javascript

Cannot seem to run mistral as it doesn't have a version

fraserburch opened this issue · 5 comments

Screenshot 2024-04-22 at 9 22 18 PM

Seems format in docs is: "stability-ai/sdxl:39ed52f2a78e934b3ba6e2a89f5b1c712de7dfea535525255b1aa35c5565e08b"
What about for mistral: This isn't working for me

mattt commented

@fraserburch What version of the Replicate library are you using? The type definitions for these functions have supported model identifiers with and without versions since #169.

run(
identifier: `${string}/${string}` | `${string}/${string}:${string}`,
options: {
input: object;
wait?: { interval?: number };
webhook?: string;
webhook_events_filter?: WebhookEventType[];
signal?: AbortSignal;
},
progress?: (prediction: Prediction) => void
): Promise<object>;
stream(
identifier: `${string}/${string}` | `${string}/${string}:${string}`,
options: {
input: object;
webhook?: string;
webhook_events_filter?: WebhookEventType[];
signal?: AbortSignal;
}
): AsyncGenerator<ServerSentEvent>;

Maybe I'll manually make the change in the index.d.ts file!
My version is definitely outdated, and I haven't had any luck updating it due to dependency conflicts!

Thanks for the code snippet. Will give this a go!

mattt commented

Maybe I'll manually make the change in the index.d.ts file!

Sounds good! Let me know how that works for you.

My version is definitely outdated, and I haven't had any luck updating it due to dependency conflicts!

I'm curious to dig into this a bit more. Replicate has only a single optional dependency, and that's a recent addition.

https://github.com/replicate/replicate-javascript/blob/main/package.json#L36-L48

Can you say more about how you've tried to upgrade and what errors you found? Like, what happens if you run npm i replicate@latest?

Hey Matt, We managed to update replicate module and resolve the conflicts. It wasn't replicate causing the conflicts, it was another module using replicate that was giving us grief!

I'll close this ticket, but just one unrelated question. If I'm interacting with the rest api, is there anyway around the call to create prediction and then separate call to get the results? would be nice to just make one call and get back the result. Thanks!

aron commented

@fraserburch we don't have a "synchronous" api at the moment, but we are working on it.