Skip to content

Nbtguyoriginal/Pytrainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation


Fine-Tuning Process Using the "Model Builder Interface, SUDOBRAIN Training Toolkit UI"

1. Introduction

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.

2. Key Functions

2.1 process_with_chatgpt(txt_content, api_key)

  • 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.

2.2 content_to_dataset(validated_content, dataset_file)

  • 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 the dataset_file in JSON format.

2.3 train_model(api_key, training_file)

  • 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.

2.4 convert_files(folder_path, api_key)

  • 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 the folder_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".

3. GUI Components

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.

4. Conclusion

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.


About

a script that will legit build itself

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages