Skip to content

Unable to Save Generated Data to JSONL File - Always Resulting in "Wrote 0 examples to finetuning_events.jsonl" Message #12433

Closed Answered by loyal812
loyal812 asked this question in Q&A
Discussion options

You must be logged in to vote

I just solved the problem.
It's my solution. Currently, It's storing the dataset to jsonl data.

def jsonl_generation(self):
        """
        Generate JSONL file for fine-tuning events and perform model refinement.
        """
        # Initialize OpenAI FineTuningHandler and CallbackManager
        finetuning_handler = OpenAIFineTuningHandler()
        callback_manager = CallbackManager([finetuning_handler])

        llm = OpenAI(model="gpt-4", temperature=0.3)
        Settings.callback_manager, = (callback_manager,)

        # Load questions for fine-tuning from a file
        questions = []
        with open(f'{self.dataset_path}/train_questions.txt', "r", encoding='utf-8') as f:
   …

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@dosubot
Comment options

@loyal812
Comment options

@dosubot
Comment options

@loyal812
Comment options

@dosubot
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by loyal812
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant