I have created my own trained model and when I request api with trained model, I am getting wrong answer or non English ( like chines) response.
This is my php code.
$apiKey = 'xxxxxxxx';
$apiEndpoint = 'https://api.openai.com/v1/completions';
$headers = array(
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey
);
// Set the prompt and fine-tuned model
$payload = array(
'prompt' => $userMessage,
'model' => 'ada:ft-xxxxxxx-2023-07-11-15-35-25'
);
// Convert the payload to JSON
$jsonPayload = json_encode($payload);
// Send the API request using cURL
$ch = curl_init($apiEndpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonPayload);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// Execute the request
$response = curl_exec($ch);
I used below sample jsonl for fine-tuning
{"prompt":"about company\n\n\n###\n\n","completion":" my company details xxx"}
{"prompt":"location - Sheikh Zayed Road\nName - xxx Trading Est\nAddress and Phone - xxxxxxx, +1 (x) xxxxx\n\n###\n\n","completion":" "}