Upload this data file to MindsDB and use it to finetune the model.
FINETUNE command creates a new version of the openai_davinci model. You can query all available versions as below:
CREATE ML_ENGINE openai_engine
FROM openai
USING
openai_api_key = 'your-openai-api-key';
CREATE MODEL openai_davinci
PREDICT completion
USING
engine = 'openai_engine',
model_name = 'davinci-002',
prompt_template = 'Return a valid SQL string for the following question about MindsDB in-database machine learning: {{prompt}}';
DESCRIBE openai_davinci;
SELECT prompt, completion
FROM openai_davinci as m
WHERE prompt = 'What is the SQL syntax to join input data with predictions from a MindsDB machine learning model?'
USING max_tokens=400;
+---------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
| prompt | completion |
+---------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
| What is the SQL syntax to join input data with predictions from a MindsDB machine learning model? | The SQL syntax is: SELECT * FROM input_data INNER JOIN predictions ON input_data.id = predictions.id |
+---------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
FINETUNE openai_davinci
FROM files
(SELECT prompt, completion FROM openai_learninghub_ft);
FINETUNE command creates a new version of the openai_davinci model. You can query all available versions as below:
SELECT *
FROM models
WHERE name = 'openai_davinci';
SELECT prompt, completion
FROM openai_davinci as m
WHERE prompt = 'What is the SQL syntax to join input data with predictions from a MindsDB machine learning model?'
USING max_tokens=400;
+---------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
| prompt | completion |
+---------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
| What is the SQL syntax to join input data with predictions from a MindsDB machine learning model? | SELECT * FROM mindsdb.models.my_model JOIN mindsdb.input_data_name; |
+---------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+
LAST keyword.Here is how to create and schedule a job to fine-tune the model periodically.CREATE JOB automated_finetuning (
FINETUNE openai_davinci
FROM mindsdb
(SELECT *
FROM files.openai_learninghub_ft
WHERE timestamp > LAST)
)
EVERY 1 day
IF (
SELECT *
FROM files.openai_learninghub_ft
WHERE timestamp > LAST
);
Was this page helpful?