Deploy a Model from Replicate on Cerebrium
predict.py
- so let us inspect that file.
Cerebrium has a similar notion in that the main file that is called on our side is main.py
.
To start, I copy across all import statements and constant variables that have nothing to do with Replicate/Cog. In this case:
self.
, remove it throughout the code.
There is a folder in the repo called “feature-extractor” which we need to have in our repository. We could git clone the repo; however, it’s quite small, so I would just copy the contents of the folder and put it in your Cerebrium project, i.e.:
cerebrium deploy
. You should see your app build in under 90 seconds.
It should output the curl statement to run your app:
/predict
(since that is the function we are calling) and send it the required JSON data. This is our result: