The provided application is a GUI based python script designed to facilitate the fine-tuning of OpenAI's GPT-3.5-turbo model. The application allows users to:
- Input their OpenAI API key.
- Select a folder containing
.txt
files. - Process these
.txt
files using the GPT-3.5-turbo model. - Convert the processed content into a dataset format suitable for fine-tuning.
- Initiate the fine-tuning process using the OpenAI API.
- View conversion logs and edit
.txt
files. - Display the folder contents and results of the operations.
- Purpose: Processes a given text content using the GPT-3.5-turbo model.
- Parameters:
txt_content
: The text to be processed.api_key
: The OpenAI API key.
- Process:
- The function sets the OpenAI API key.
- It then sends the
txt_content
to the OpenAI API for processing. - The processed response is returned.
- Purpose: Converts the processed content into a dataset format.
- Parameters:
validated_content
: The processed content.dataset_file
: The file where the dataset will be saved.
- Process:
- The function writes the
validated_content
to thedataset_file
in JSON format.
- The function writes the
- Purpose: Initiates the fine-tuning process using the OpenAI API.
- Parameters:
api_key
: The OpenAI API key.training_file
: The dataset file to be used for fine-tuning.
- Process:
- The function sets the OpenAI API key.
- It sends the
training_file
to the OpenAI API for fine-tuning. - The ID of the fine-tuning job is returned.
- Purpose: Processes
.txt
files in a given folder and converts them into a dataset format. - Parameters:
folder_path
: The path to the folder containing the.txt
files.api_key
: The OpenAI API key.
- Process:
- For each
.txt
file in thefolder_path
, the content is read and processed using the GPT-3.5-turbo model. - The processed content is then added to the dataset.
- The dataset is saved in the
folder_path
as "dataset.json".
- For each
The script uses tkinter
to create a graphical user interface. Key components include:
- API Configuration Section: Allows users to input their OpenAI API key.
- File and Training Section: Provides buttons to select a folder with
.txt
files and start the training process. - Logs and Editing Section: Allows users to view conversion logs and edit
.txt
files. - Folder Contents Section: Displays the contents of the selected folder.
- Results Section: Displays the results of the operations.
The "Model Builder Interface, SUDOBRAIN Training Toolkit UI" script provides a comprehensive tool for users to fine-tune the GPT-3.5-turbo model using their own .txt
files. The process involves processing the .txt
files, converting them into a dataset format, and initiating the fine-tuning process using the OpenAI API.