Skip to content

Commit

Permalink
Merge pull request #9207 from mindsdb/finetune-tutorials
Browse files Browse the repository at this point in the history
updated automated finetuning tutorials
  • Loading branch information
ZoranPandovski committed May 14, 2024
2 parents 807e1df + 39f1967 commit 037f87c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 60 deletions.
27 changes: 12 additions & 15 deletions docs/use-cases/automated_finetuning/anyscale.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,29 +157,26 @@ On execution, we get:
<Tip>
If you have dynamic data that gets updated regularly, you can set up an automated fine-tuning as below.

Note that the data source must contain an incremental column, such as timestamp or integer, so MindsDB can pick up only the recently added data.
Note that the data source must contain an incremental column, such as timestamp or integer, so MindsDB can pick up only the recently added data with the help of the [`LAST` keyword](/mindsdb_sql/sql/create/jobs#last).

Create a view to store recently added data with the help of the [`LAST` keyword](/mindsdb_sql/sql/create/jobs#last):

```sql
CREATE VIEW recent_data (
SELECT *
FROM example_db.chat_llm_mindsdb_docs
WHERE timestamp > LAST
);
```

Create a job to fine-tune the model periodically.
Here is how to create and schedule a job to fine-tune the model periodically.

```sql
CREATE JOB automated_finetuning (

FINETUNE mymistral7b
FROM mindsdb
(SELECT * FROM recent_data)
(SELECT *
FROM example_db.chat_llm_mindsdb_docs
WHERE timestamp > LAST)
)
EVERY 1 day;
EVERY 1 day
IF (
SELECT *
FROM example_db.chat_llm_mindsdb_docs
WHERE timestamp > LAST
);
```

Now your model will be fine-tuned with newly added data every day.
Now your model will be fine-tuned with newly added data every day or every time there is new data available.
</Tip>
27 changes: 12 additions & 15 deletions docs/use-cases/automated_finetuning/classification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,29 +116,26 @@ Here after adjusting the model, there are no significant changes to the predicti
<Tip>
If you have dynamic data that gets updated regularly, you can set up an automated fine-tuning as below.

Note that the data source must contain an incremental column, such as timestamp or integer, so MindsDB can pick up only the recently added data.
Note that the data source must contain an incremental column, such as timestamp or integer, so MindsDB can pick up only the recently added data with the help of the [`LAST` keyword](/mindsdb_sql/sql/create/jobs#last).

Create a view to store recently added data with the help of the [`LAST` keyword](/mindsdb_sql/sql/create/jobs#last):

```sql
CREATE VIEW recent_data (
SELECT *
FROM example_db.customer_churn
WHERE timestamp > LAST
);
```

Create a job to fine-tune the model periodically.
Here is how to create and schedule a job to fine-tune the model periodically.

```sql
CREATE JOB automated_finetuning (

FINETUNE adjust_customer_churn_model
FROM mindsdb
(SELECT * FROM recent_data)
(SELECT *
FROM example_db.customer_churn
WHERE timestamp > LAST)
)
EVERY 1 day;
EVERY 1 day
IF (
SELECT *
FROM example_db.customer_churn
WHERE timestamp > LAST
);
```

Now your model will be fine-tuned with newly added data every day.
Now your model will be fine-tuned with newly added data every day or every time there is new data available.
</Tip>
27 changes: 12 additions & 15 deletions docs/use-cases/automated_finetuning/openai.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,29 +108,26 @@ On execution, we get:
<Tip>
If you have dynamic data that gets updated regularly, you can set up an automated fine-tuning as below.

Note that the data source must contain an incremental column, such as timestamp or integer, so MindsDB can pick up only the recently added data.
Note that the data source must contain an incremental column, such as timestamp or integer, so MindsDB can pick up only the recently added data with the help of the [`LAST` keyword](/mindsdb_sql/sql/create/jobs#last).

Create a view to store recently added data with the help of the [`LAST` keyword](/mindsdb_sql/sql/create/jobs#last):

```sql
CREATE VIEW recent_data (
SELECT *
FROM files.openai_learninghub_ft
WHERE timestamp > LAST
);
```

Create a job to fine-tune the model periodically.
Here is how to create and schedule a job to fine-tune the model periodically.

```sql
CREATE JOB automated_finetuning (

FINETUNE openai_davinci
FROM mindsdb
(SELECT * FROM recent_data)
(SELECT *
FROM files.openai_learninghub_ft
WHERE timestamp > LAST)
)
EVERY 1 day;
EVERY 1 day
IF (
SELECT *
FROM files.openai_learninghub_ft
WHERE timestamp > LAST
);
```

Now your model will be fine-tuned with newly added data every day.
Now your model will be fine-tuned with newly added data every day or every time there is new data available.
</Tip>
27 changes: 12 additions & 15 deletions docs/use-cases/automated_finetuning/regression.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,29 +124,26 @@ On execution, we get:
<Tip>
If you have dynamic data that gets updated regularly, you can set up an automated fine-tuning as below.

Note that the data source must contain an incremental column, such as timestamp or integer, so MindsDB can pick up only the recently added data.
Note that the data source must contain an incremental column, such as timestamp or integer, so MindsDB can pick up only the recently added data with the help of the [`LAST` keyword](/mindsdb_sql/sql/create/jobs#last).

Create a view to store recently added data with the help of the [`LAST` keyword](/mindsdb_sql/sql/create/jobs#last):

```sql
CREATE VIEW recent_data (
SELECT *
FROM example_db.home_rentals
WHERE timestamp > LAST
);
```

Create a job to fine-tune the model periodically.
Here is how to create and schedule a job to fine-tune the model periodically.

```sql
CREATE JOB automated_finetuning (

FINETUNE adjust_home_rentals_model
FROM mindsdb
(SELECT * FROM recent_data)
(SELECT *
FROM example_db.home_rentals
WHERE timestamp > LAST)
)
EVERY 1 day;
EVERY 1 day
IF (
SELECT *
FROM example_db.home_rentals
WHERE timestamp > LAST
);
```

Now your model will be fine-tuned with newly added data every day.
Now your model will be fine-tuned with newly added data every day or every time there is new data available.
</Tip>

0 comments on commit 037f87c

Please sign in to comment.