Installing the environment
Installing an environment has become complex with the rapid evolution of AI and cross-platform dependency conflicts, as we saw in Chapter 2, RAG Embedding Vector Stores with Deep Lake and OpenAI, in the Setting up the environment section. We will thus freeze the package versions when possible.
For this program, open the Fine_tuning_OpenAI_GPT_4o_mini.ipynb
notebook in the Chapter09
directory on GitHub. The program first retrieves the OpenAI API key:
#You can retrieve your API key from a file(1)
# or enter it manually(2)
#Comment this cell if you want to enter your key manually.
#(1)Retrieve the API Key from a file
#Store you key in a file and read it(you can type it directly in the notebook but it will be visible for somebody next to you)
from google.colab import drive
drive.mount('/content/drive')
f = open("drive/MyDrive/files/api_key.txt", "r")
API_KEY=f.readline()
f.close()
We then install openai
and set the...