cog icon indicating copy to clipboard operation
cog copied to clipboard

How to load the model correctly without running any prediction ? ( Just warming )

Open JonathannJacobs opened this issue 9 months ago • 3 comments

I suppose calling the /predictions with falsy value can do the trick but it feels dirty. Is there a nicer way to pre warm a model ? The idea would be to pre warm when the user select such model but before launching the generation, potentially never launching it indeed, but i'm okay with this.

Thanks

JonathannJacobs avatar Apr 12 '25 19:04 JonathannJacobs

I do believe that cog calls the runners setup once the FastAPI app has started up, so it should be warm, can you let me know anything about your setup that might be causing it not to honour this contract?

8W9aG avatar Apr 17 '25 17:04 8W9aG

Well the way i trigger the docker mounting is by calling the full url with /prediction, maybe calling it without would work, but i was asking for the 'clean way'. Maybe its clean this way ? Would just pinging the url on the machine prevents it to cool down too ?

JonathannJacobs avatar Apr 23 '25 13:04 JonathannJacobs

Ah I see, I believe what you may want is something like /docs might work for you here.

8W9aG avatar Apr 24 '25 15:04 8W9aG