Basic Cairo CLI Example
For this example we will create a user, retrieve information from it and transpile a model.
Create User
This is the first step! We create the user and then we need to verify the account by checking the email.
Then we need to verify the email. We just need to click on the button and we'll be redirected to the verification endpoint.
Login
If it is not verified login will be disabled!
But once we verify the account we will be able to authenticate with Giza.
Retrieve user information
Now that we are authenticated we can connect with Giza!
Create API Key
You can also create an API key for the current user. This API key will be stored and will be used to authenticate the user in the future.
NOTE: The usage of API key is less secure than JWT, so use it with caution.
Transpiling a Model
Now that we have our onnx
model, it's time to transpile it into a format that's compatible with giza
. Transpilation is a process where we convert the model from one format to another without changing its underlying functionality. In this case, we're converting our onnx
model into a cairo
model. This is a crucial step as it allows us to leverage the power of giza
and its ecosystem.
But don't worry, giza
makes this process a breeze with a simple command! Let's dive into it.
As you can see from the console output, if the model does not previously exist, giza
will automatically create one for you. It assigns a unique id to the new model, in this case, the id is 25. This is indicated by the line [giza][2024-02-07 16:31:21.599] Model Created with id -> 1! β
.
After the model is created, giza
will create a new version for it [giza][2024-02-07 16:31:22.436] Version Created with id -> 1! β
and send it for transpilation. This is indicated by the line [giza][2024-02-07 16:31:22.437] Sending model for transpilation β
. The transpiled model is then saved at the specified output path.
This feature of giza
makes it easy to manage and version your models. You don't have to worry about manually creating a new model or version, giza
handles it for you.
Additionally, giza
provides an option to specify the model id while transpiling. If you already have a model and want to create a new version for it, you can use the --model-id
option followed by the id of the model. This will create a new version for the existing model instead of creating a new model. Here's how you can do it:
Now let's check the result:
Last updated