Creating AI fine-tuned models
The Fine-Tuned Models tab allows you to create fine-tuned models from downloaded models that can then be loaded and used for text generation. Multiple fine-tuned models may be created, but only one text generation model may be loaded into memory for use at any given time.
Important You must first enable the model server and the fine-tuning option before the Fine-Tuned Models tab will be available. Some models require you to include a Hugging Face token in the Model Server tab to download the model. See Starting, stopping, and updating the AI model server and Configuring AI settings.
To create a fine-tuned model:
-
Click the AI Services > Fine-Tuned Models tab.
-
Click Create Fine-Tuned Model.
-
In the Create a Fine-Tuned Model dialog, click Browse, then browse for the JSONL file containing the training data.
Each line in the training data JSONL file should contain an example of a user input and the valid response to the input. For example:
Copy{"messages":[{"content":"System prompt","role":"system"},{"content":"Example user data","role":"user"},{"content":"Example system output after processing user data"}]}
{"messages":[{"content":"sys.123","role":"system"},{"content":"usr.234","role":"user"},{"content":"ast.345","role":"assistant"}]}
{"messages":[{"content":"sys.456","role":"system"},{"content":"usr.567","role":"user"},{"content":"ast.678","role":"assistant"}]} -
In the Create a Fine-Tuned Model dialog, enter the following information:
-
Fine-Tuned Model Name: The name of the model you want to use for client connections. The AI model server will prefix the specified name with "fm-mlx-" so the actual name of the fine-tuned model will be "fm-mlx-<specified_name>".
-
Base Model: Select the model you want to fine-tune.
Note Base models must be a text generation model that is already downlaoded and acknowledged.
-
Number of Iterations: The number of training iterations. More iterations takes more memory and more time to process.
-
LoRA Layers: The number of low-rank adaptation layers (LoRA). More layers takes more memory and time.
-
Batch Size: The number of training examples to train the model with at one time. The larger the batch size, the more memory required, though the training may complete more quickly.
-
-
Click Create Model.