This project implements a Chain of Thought (CoT) approach to solve math problems from the GSM8K dataset using DSPy and OpenAI's GPT-3.5-turbo model.
- Utilizes DSPy framework for natural language processing tasks
- Implements Chain of Thought reasoning
- Uses OpenAI's GPT-3.5-turbo model
- Includes evaluation and optimization components
-
Install required packages:
pip install dspy openai
-
Set up OpenAI API key in your environment variables.
Run main.py
to:
- Initialize the CoT model
- Evaluate the baseline model
- Optimize the model using BootstrapFewShotWithRandomSearch
- Save the compiled model
CoT
: Implements the Chain of Thought moduleEvaluate
: Assesses model performance on the dev setBootstrapFewShotWithRandomSearch
: Optimizes the model using few-shot learning
The optimized model is saved as iu_demo.json
.
Ensure you have necessary permissions and credits to use the OpenAI API.