Sorry I have been trying to figure out how to use what you sent with the script I fine tuned with originally but do not know how to add it, I have only been coding for 2 weeks and am massively struggling. I found this code that has the epoch variables, can you explain which parts I need to change in this script to beable to run it please?
import openai
import requests
openai.api_key = “INSERT_YOUR_API_KEY_HERE”
def fine_tune_model(prompt, dataset, model_engine=”davinci”, num_epochs=3, batch_size=4):
headers = {
“Content-Type”: “application/json”,
“Authorization”: f”Bearer {openai.api_key}”,
}
data = {
“model”: f”{model_engine}-0",
“dataset”: dataset,
“prompt”: prompt,
“num_epochs”: num_epochs,
“batch_size”: batch_size
}
url = “https://api.openai.com/v1/fine-tunes"
response = requests.post(url, headers=headers, json=data)
if response.status_code != 200:
raise ValueError(“Failed to fine-tune the model.”)
# Get the ID of the fine-tuned model
model_id = response.json()[“model_id”]
return model_id
