Running a model
Now that you have a trained model, it's time to run it.
Before downloading a model, you can use the built-in playground to try out a few prompts on the trained model.
Downloading a model
There are 2 ways to download a trained model:
Through the dashboard
Using the API
You can download the model from the dashboard by using the "Download model" button on the overview page of a dataset.
For downloading a model using the API:
You need to get an API key from the dataset page.
Call the model download endpoint of the API using this API key as defined here. (You can get the model ID from the overview page)
You will receive a url in the response which you can use to download the model using a tool like wget.
Through both the download methods, you will have a zip file which has all the necessary files to run the model.
To run the model we need to unzip the file-
The resulting directory will look like this-
One last thing needed to run the model is the transformers library by huggingface, you can go ahead and install it by
Now we have everything needed to run the model, we will use the following code to actually run it-
The above code loads the model, runs inference and prints the output.
Note: The above model formats the prompt according to the mistral prompt format. If you have trained using Llama 3 as the base model use the following prompt template:
Last updated