Datafile for Fine-Tuning Chat models

I have a jsonl file says:

{"messages": [{"role": "system", "content": "You are tasked with taking natural language inputs in Korean from the user and converting them into SQL queries."}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}

Each message is written on a single line.

I’m trying to fine-tunning gpt-3.5-turbo with this jsonl file.

jsonl_file_path = '/content/drive/My Drive/ABC Crew 2조/nl_sql_pairs.jsonl'

client = OpenAI()

file = client.files.create(
    file=open(jsonl_file_path, 'rb'),
    purpose='fine-tune'
)

response = client.fine_tuning.jobs.create(
    training_file=file.id,
    model= "gpt-3.5-turbo"
)
print(response)

fine_tune_status = client.fine_tuning.jobs.retrieve('ftjob-BLvQztNMN5ePXimBlzgKPvso')
print(fine_tune_status.status)
print(fine_tune_status.error)

BUT I have an error like this:
Error(code=‘invalid_training_file’, message=‘The job failed due to an invalid training file. Invalid file format. Input file file-kwak1XyiPwy2ZzG6TwL8lCTa is in the prompt-completion format, but the specified model gpt-3.5-turbo-0125 is a chat model and requires chat-formatted data. See https://platform.openai.com/docs/guides/fine-tuning/preparing-your-dataset for details.’, param=‘training_file’)

WHAT’S WRONG WITH ME?

2 Likes

Hi there and welcome to the Forum!

The issue is related to your first line.
Each training example needs to have at a minimum one user message and one assistant message. Optionally, you also can include a system message. However, you cannot create an example solely consisting of a system message.

Also, bear in mind that every training example needs to be self-sufficient. In your case, what you want to do is to integrate the system message into each of your other examples. So one training example should looks as follows:

{"messages": [{"role": "system", "content": "You are tasked with taking natural language inputs in Korean from the user and converting them into SQL queries."}, {"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}

Thank you for your reply. But it also doesn’t work.
I tried some chat-completion cases but nothing worked.

case1:

{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}

case2:

{"messages": [{"role": "system", "content": "You are tasked with taking natural language inputs in Korean from the user and converting them into SQL queries."}, {"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "system", "content": "You are tasked with taking natural language inputs in Korean from the user and converting them into SQL queries."}, {"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "system", "content": "You are tasked with taking natural language inputs in Korean from the user and converting them into SQL queries."}, {"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "system", "content": "You are tasked with taking natural language inputs in Korean from the user and converting them into SQL queries."}, {"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "system", "content": "You are tasked with taking natural language inputs in Korean from the user and converting them into SQL queries."}, {"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "system", "content": "You are tasked with taking natural language inputs in Korean from the user and converting them into SQL queries."}, {"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "system", "content": "You are tasked with taking natural language inputs in Korean from the user and converting them into SQL queries."}, {"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "system", "content": "You are tasked with taking natural language inputs in Korean from the user and converting them into SQL queries."}, {"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "system", "content": "You are tasked with taking natural language inputs in Korean from the user and converting them into SQL queries."}, {"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "content": "SELECT * FROM customers WHERE city = '서울';"}]}
{"messages": [{"role": "system", "content": "You are tasked with taking natural language inputs in Korean from the user and converting them into SQL queries."}, {"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "content": "SELECT * FROM customers WHERE city = '서울';"}]}

and case3 was the code what I posted.

1 Like

My apologies - I realized there was a duplication in the example shared; the role: “assistant” contained a duplicated “content” key.

I have corrected the example now and also tested it with your examples with the corrected version on my end and it worked just fine. Here again the updated version for reference.

{"messages": [{"role": "system", "content": "You are tasked with taking natural language inputs in Korean from the user and converting them into SQL queries."}, {"role": "user", "content": "서울에 거주하는 고객"}, {"role": "assistant", "content": "SELECT * FROM customers WHERE city = '서울';"}]}

Again, apologies for the oversight on my end.

1 Like

I didn’t recognized your line had duplicated “content” key.

Anyway, I wanted to say that I also tried what you instructed me.
And still, it doesn’t work. (even with your new code)

Is there any systemic error with me?

I’m on google colab and my full code is as follows:

!pip install openai mysql-connector-python
!pip install pandas
!PIP install --upgrade openai

import openai
import mysql.connector
import pandas as pd
import json
import os
from openai import OpenAI

from google.colab import drive

mount_point = '/content/drive'
if not os.path.exists(mount_point):
    os.makedirs(mount_point)

drive.mount(mount_point)

openai.api_key=' '   #I put my own key.

os.environ["OPENAI_API_KEY"] = " "
openai.api_key = os.getenv("OPENAI_API_KEY")

jsonl_file_path = '/content/drive/My Drive/ABC Crew 2조/nl_sql_pairs.jsonl'

client = OpenAI()

file = client.files.create(
    file=open(jsonl_file_path, 'rb'),
    purpose='fine-tune'
)

response = client.fine_tuning.jobs.create(
    training_file=file.id,
    model= "gpt-3.5-turbo"
)
print(response)

fine_tune_status = client.fine_tuning.jobs.retrieve('ftjob-BLvQztNMN5ePXimBlzgKPvso')
print(fine_tune_status.status)
print(fine_tune_status.error)

What error are you getting now? Still a file related error?

Yes, still the same error as follows:

FineTuningJob(id=‘ftjob-91E99XWNVIdALzHMMABEQEy0’, created_at=1729323752, error=Error(code=None, message=None, param=None), fine_tuned_model=None, finished_at=None, hyperparameters=Hyperparameters(n_epochs=‘auto’, batch_size=‘auto’, learning_rate_multiplier=‘auto’), model=‘gpt-3.5-turbo-0125’, object=‘fine_tuning.job’, organization_id=‘org-9yDupkSbmzaLDVk5PwcBrWel’, result_files=[], seed=1872972633, status=‘validating_files’, trained_tokens=None, training_file=‘file-EnKrGWOygtlI39waphS5d7zY’, validation_file=None, estimated_finish=None, integrations=[], user_provided_suffix=None)
failed
Error(code=‘invalid_training_file’, message=‘The job failed due to an invalid training file. Invalid file format. Input file file-kwak1XyiPwy2ZzG6TwL8lCTa is in the prompt-completion format, but the specified model gpt-3.5-turbo-0125 is a chat model and requires chat-formatted data. See https://platform.openai.com/docs/guides/fine-tuning/preparing-your-dataset for details.’, param=‘training_file’)

Welcome to the dev forum @dong200599

I’d recommend validating your fine-tuning dataset before creating the fine-tune job.

Here’s OpenAI’s cookbook code for the same.

I’d also recommend using the exact dated model name instead of the model alias.

2 Likes

Thank you for your advice.

I validated my fine-tuning dataset referring to the given cookbook.

And I got some results:
‘No errors found’

'Num examples missing system message: 0
Num examples missing user message: 0

Distribution of num_messages_per_example:

min / max: 3, 3
mean / median: 3.0, 3.0
p5 / p95: 3.0, 3.0

Distribution of num_total_tokens_per_example:

min / max: 59, 59
mean / median: 59.0, 59.0
p5 / p95: 59.0, 59.0

Distribution of num_assistant_tokens_per_example:

min / max: 12, 12
mean / median: 12.0, 12.0
p5 / p95: 12.0, 12.0

0 examples may be over the 16,385 token limit, they will be truncated during fine-tuning’

’ Dataset has ~649 tokens that will be charged for during training By default, you’ll train for 9 epochs on this dataset By default, you’ll be charged for ~5841 tokens

—’

So I was able to confirm that there were no issues with my dataset.
But the same error continues.

I hope you do not intend to send just that one line, which would train an AI to only produce one exact output.

A training file should be extensive, covering all possible inputs that may be encountered and all outputs that those generate: even abnormal data. Think hundreds or thousands.

The input should look like what you actually would send. Not sentences if you are sending documents.

Here is a small example JSONL training file in “chat” format, with the required fields and formatting, along with producing some errors for “no cities” or “multiple cities”, and a system prompt that you would reuse when employing the AI model.

I intentionally left the SQL structure out of the system prompt, so we can see the fine-tune works to alter the AI behavior. More prompt text about the application, or a container around the user input such as “extract any cities from this document text for query”, will improve performance even more.

한국어로의 번역입니다.

저는 당신이 단지 그 한 줄만 보내려고 하는 것이 아니길 바랍니다. 그렇게 하면 AI가 오직 하나의 정확한 출력만 생성하도록 학습될 것입니다.

훈련 파일은 광범위해야 하며, 발생할 수 있는 모든 입력과 그에 따른 모든 출력을 포함해야 합니다. 비정상적인 데이터까지도요. 수백 또는 수천 개를 생각해 보세요.

입력은 실제로 당신이 보낼 것과 유사해야 합니다. 문서를 보내는 경우라면, 문장이 아닌 문서 형식이어야 합니다.

여기에 ‘채팅’ 형식의 작은 예제 JSONL 훈련 파일이 있습니다. 필요한 필드와 형식이 포함되어 있으며, ‘도시 없음’ 또는 '여러 도시’에 대한 일부 오류를 생성하고, AI 모델을 사용할 때 재사용할 시스템 프롬프트도 포함되어 있습니다.

저는 의도적으로 시스템 프롬프트에서 SQL 구조를 제외시켰습니다. 이는 미세 조정이 어떻게 AI의 동작을 변경하는지 보기 위해서입니다. 애플리케이션에 대한 더 많은 프롬프트 텍스트나 사용자 입력 주위에 "이 문서 텍스트에서 쿼리를 위한 모든 도시를 추출하세요"와 같은 컨테이너를 추가하면 성능이 더욱 향상될 것입니다.

{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"서울에 있는 지점을 방문하다"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '서울';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"부산에서 열린 회의 참석자"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '부산';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"대구 출신의 고객 목록"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '대구';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"인천에 거주하는 직원"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '인천';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"광주에서 구매한 고객 정보"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '광주';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"뉴욕에 사는 고객들"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '뉴욕';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"도쿄 지사를 위한 보고서"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '도쿄';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"파리에서 주문한 상품"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '파리';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"베를린에 본사를 둔 회사"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '베를린';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"시드니에서 온 연락처"},{"role":"assistant","content":"SELECT * FROM customers WHERE city = '시드니';"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"고객 목록을 확인하다"},{"role":"assistant","content":"ERROR: 도시 엔티티 없음"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"최근 구매한 제품"},{"role":"assistant","content":"ERROR: 도시 엔티티 없음"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"새로운 회원 가입"},{"role":"assistant","content":"ERROR: 도시 엔티티 없음"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"주문 내역 조회"},{"role":"assistant","content":"ERROR: 도시 엔티티 없음"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"서비스 이용 통계"},{"role":"assistant","content":"ERROR: 도시 엔티티 없음"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"서울과 부산에 있는 고객 목록"},{"role":"assistant","content":"ERROR: 여러 도시 엔티티"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"도쿄와 파리에서 주문한 내역"},{"role":"assistant","content":"ERROR: 여러 도시 엔티티"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"뉴욕, 베를린, 시드니의 지점 정보"},{"role":"assistant","content":"ERROR: 여러 도시 엔티티"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"인천 또는 광주에 거주하는 직원"},{"role":"assistant","content":"ERROR: 여러 도시 엔티티"}]}
{"messages":[{"role":"system","content":"You extract `city`, and query the `customer` database for matches."},{"role":"user","content":"부산 및 대구 출신의 고객"},{"role":"assistant","content":"ERROR: 여러 도시 엔티티"}]}

Fine-tune, using the platform site user interface (1 epoch pass through file)

Using the model, with new type of input needing AI interpolation (English):

1M or 2M tokens free per day thru the end of the month!

Submit your similar file through the platform site instead of code. Inspect closely for errors, such as directional or non-English quote characters.

Thank you. Your jsonl file still doesn’t work.

I think it is not the issue regarding dataset structure or extensivity, because the jsonl file that worked for other but not for me. (as you see jr.2509’s reply above.)

So, I’m questioning whether some systemic issues exist, and whether those issues are preventing the system from recognizing that the dataset (JSONL) is already in chat format, incorrectly assuming it’s in prompt-completion format (which is not true).

So that makes the error:
Error(code=‘invalid_training_file’, message=‘The job failed due to an invalid training file. Invalid file format. Input file file-kwak1XyiPwy2ZzG6TwL8lCTa is in the prompt-completion format, but the specified model gpt-3.5-turbo-0125 is a chat model and requires chat-formatted data. See https://platform.openai.com/docs/guides/fine-tuning/preparing-your-dataset for details.’, param=‘training_file’)

If the data is proven to work - we must assume it is the code.

model: gpt-4o-mini-2024-07-18 is recommended, free to train right now up to 2M tokens, and will have a longer lifespan.

We should eliminate the openai library, which may be obsolete on another’s Python platform. Let’s use the requests module, and the environment API key.


데이터가 제대로 작동하는 것으로 확인되면, 문제는 코드에 있다고 가정해야 합니다.

모델: gpt-4o-mini-2024-07-18을 추천합니다. 무료로 학습 가능하며, 더 긴 수명을 가질 것입니다.

다른 사람의 Python 환경에서 openai 라이브러리가 오래되어 사용할 수 없을 가능성이 있으니 이를 제거하는 것이 좋습니다. 대신 requests 모듈과 환경 변수에 저장된 API 키를 사용합시다.

import os
import requests
import time

# File path to the training data
jsonl_file_path = '/content/drive/My Drive/ABC Crew 2조/nl_sql_pairs.jsonl'

# parameters
SUFFIX = "city"  # suffix to add to model name
MODEL = "gpt-4o-mini-2024-07-18"
EPOCHS = 1  # passes through file

# Get the API key from environment variable
api_key = os.getenv('OPENAI_API_KEY')
if not api_key:
    print("Error: OPENAI_API_KEY environment variable is not set.")
    exit(1)

# Define headers for authentication
headers = {
    "Authorization": f"Bearer {api_key}"
}


# Step 1: Upload the training file
def upload_file(file_path):
    upload_url = 'https://api.openai.com/v1/files'
    with open(file_path, 'rb') as f:
        files = {
            'file': (os.path.basename(file_path), f),
            'purpose': (None, 'fine-tune')
        }
        print("Uploading file...")
        response = requests.post(upload_url, headers=headers, files=files)
    if response.status_code != 200:
        print(f"Error uploading file: {response.status_code} {response.text}")
        exit(1)
    file_info = response.json()
    file_id = file_info['id']
    print(f"File uploaded successfully. File ID: {file_id}")
    return file_id

# Step 2: Initiate the fine-tuning job
def start_fine_tuning(file_id):
    fine_tune_url = 'https://api.openai.com/v1/fine_tuning/jobs'
    data = {
        "training_file": file_id,
        "model": MODEL,
        "suffix": SUFFIX,
        "hyperparameters": {
          "n_epochs": EPOCHS
        }
    }
    print("Starting fine-tuning job...")
    response = requests.post(fine_tune_url, headers=headers, json=data)
    if response.status_code != 200:
        print(f"Error starting fine-tuning job: {response.status_code} {response.text}")
        exit(1)
    job_info = response.json()
    job_id = job_info['id']
    print(f"Fine-tuning job started. Job ID: {job_id}")
    return job_id

# Step 3: Monitor the fine-tuning job status
def monitor_fine_tuning(job_id):
    job_status_url = f'https://api.openai.com/v1/fine_tuning/jobs/{job_id}'
    while True:
        response = requests.get(job_status_url, headers=headers)
        if response.status_code != 200:
            print(f"Error retrieving fine-tuning job status: {response.status_code} {response.text}")
            exit(1)
        job_status = response.json()
        status = job_status.get('status')
        print(f"Fine-tuning job status: {status}")
        if status in ['succeeded', 'failed', 'cancelled']:
            print("Fine-tuning job has completed.")
            if status == 'failed':
                error = job_status.get('error')
                if error:
                    print(f"Error details: {error}")
            break
        else:
            time.sleep(10)

# Main execution flow
if __name__ == '__main__':
    file_id = upload_file(jsonl_file_path)
    job_id = start_fine_tuning(file_id)
    monitor_fine_tuning(job_id)

This performs similarly on the file just demonstrated:

Uploading file...
File uploaded successfully. File ID: file-FAaYf0NmwxOHi3cP4q5wXot4
Starting fine-tuning job...
Fine-tuning job started. Job ID: ftjob-qK7jmI2234jd3fxi7GsLB8t8
Fine-tuning job status: validating_files
Fine-tuning job status: running
Fine-tuning job status: running
Fine-tuning job status: running
Fine-tuning job status: running
Fine-tuning job status: running
Fine-tuning job status: running
Fine-tuning job status: succeeded
Fine-tuning job has completed.

Oh I appreciate for your help. It worked!!

By the way, one more thing here:
When I give the model the exact same sentence as the user content from the JSONL file to test it, the output does not match the assistant content. Why is that?

You must also use the system prompt to activate the behavior.

The chat model still has extensive training on how to act, that you are overriding with the new weights being learned.

The setting for EPOCHS=1 in the Python file, for testing, is lower than the default, which may be 3 to 9 depending on the training file size. If you were to set the epochs high (such as 15), then you will receive named “steps” of model also in the models listing, created at points during the progress of fine-tune, where you can evaluate each to find which strength works best. Epochs is repeating the file training again.

Also, the training file itself is small. Training more on the behavior even in other cases would get closer to one of the inputs being satisfied as desired.

The AI is inferring, not reciting stupidly like a parrot, when you have the right amount of training.

1 Like