Hey can anybody help me, i’ve been going around in circles for days here!
Trying to upload training data but getting
“Error creating file for fine-tuning: 415 - Unsupported Media Type”
No matter what I do.
Here’s my latest code to upload it
<%
’ Define your OpenAI API key
apiKey = “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”
’ Specify the path to your JSONL file
jsonlFile = “scott-trainingdata.jsonl”
’ Read the JSONL data from the file
Set fs = Server.CreateObject(“Scripting.FileSystemObject”)
Set jsonlFileObject = fs.OpenTextFile(Server.MapPath(jsonlFile), 1, False)
jsonlData = jsonlFileObject.ReadAll
jsonlFileObject.Close
’ Create a file for fine-tuning
Set objHTTP = Server.CreateObject(“MSXML2.ServerXMLHTTP.6.0”)
objHTTP.Open “POST”, “link to upload removed due to forum terms”, False
objHTTP.setRequestHeader “Content-Type”, “application/octet-stream”
objHTTP.setRequestHeader “Authorization”, "Bearer " & apiKey
’ Send the request with the file content as octet-stream
objHTTP.Send jsonlData
’ Check if the file creation was successful
If objHTTP.Status = 200 Then
’ Parse the JSON response to get the file ID
Set json = Server.CreateObject(“JSONLib2.JSON”)
json.LoadJSON objHTTP.responseText
fileId = json.data.id
’ Initiate the fine-tuning job
Set objHTTP = Server.CreateObject(“MSXML2.ServerXMLHTTP.6.0”)
objHTTP.Open “POST”, “link to fine tunes removed due to forum terms”, False
objHTTP.setRequestHeader “Content-Type”, “application/json”
objHTTP.setRequestHeader “Authorization”, "Bearer " & apiKey
’ Prepare the fine-tuning payload
fineTunePayload = “{”“training_file”“: “”” & fileId & “”“, ““model””: ““gpt-3.5-turbo””}”
’ Send the fine-tuning request with the payload
objHTTP.Send fineTunePayload
’ Check if the fine-tuning job creation was successful
If objHTTP.Status = 200 Then
’ Fine-tuning job created successfully
Response.Write “Fine-tuning job created successfully.”
Else
’ Handle any errors
Response.Write "Error creating fine-tuning job: " & objHTTP.Status & " - " & objHTTP.statusText
End If
Else
’ Handle any errors
Response.Write "Error creating file for fine-tuning: " & objHTTP.Status & " - " & objHTTP.statusText
End If
%>
Here is a sample from my jsonL file
{“messages”: [{“role”: “system”, “content”: “Your name is Scott. You are a support engineer.”}, {“role”: “user”, “content”: “My payment did not work”}, {role": “assistant”, “content”: “We are sorry to hear your payment did not work on the website. We don’t have access to see why the payment failed, nor can we see your payment details. I would advise you to try a different card or make the Payment with PayPal, if you have a PayPal account.”}]}
{“messages”: [{“role”: “system”, “content”: “Your name is Scott. You are a support engineer.”}, {“role”: “user”, “content”: "How do I find “}, {role”: “assistant”, “content”: "We have made our website really easy. "}]}