The Open AI response is taken from default model, if we point to custom model response is not given as expected
Please post your API code and the full error message returned from the API.
Then, we can help you
$complete = $open_ai->completion([
** âmodelâ => âdavinci:ft-personal:infy7latest-2023-02-08-05-24-19â, //custom model name**
** âpromptâ => $prompt,**
** âtemperatureâ => 0.7,**
** âmax_tokensâ => 256,**
** âtop_pâ => 1,**
** âfrequency_penaltyâ => 0,**
** âpresence_penaltyâ => 0,**
** âstreamâ => true**
], function($curl_info, $data){
** echo $data;**
** echo PHP_EOL;**
** ob_flush();**
** flush();**
** return strlen($data);**
});
on that custom model, I uploaded some json lines format prompt and completion. If human enter any one of prompt in input, need to fetch data from my custom feed.
Thanks
I donât use PHP for the OpenAI API.
However, the API does return an full JSON message from the API, even when it fails.
Please post that entire response in itâs entirety.
Thanks
Iâm not getting any error response.
data.jsonl
{âpromptâ:âItem=handbag, Color=army_green, price=$99, size=S->â, âcompletionâ:" This stylish small green handbag will add a unique touch to your look, without costing you a fortune."}
Text: I want item of handbag and color as army green
Response of my chat:
data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: â\nâ, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: â\nâ, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: âTheâ, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " Patricia", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " Nash", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " Ar", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: ânoâ, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " Leather", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " Cross", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: âbodyâ, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " Bag", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " in", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " Army", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " Green", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " is", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " a", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " great", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " choice", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: â.â, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " This", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " stylish", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " bag", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " features", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " a", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " top", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " zip", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " closure", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: â,â, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " a", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " removable", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: â,â, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " adjustable", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " cross", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: âbodyâ, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " strap", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: â,â, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " an", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " interior", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " zip", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " pocket", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: â,â, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " and", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " an", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " exterior", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " front", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " slip", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " pocket", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: â.â, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " It", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " is", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " crafted", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " from", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " fine", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " Italian", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " leather", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " and", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " is", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " available", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " in", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " a", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " beautiful", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " army", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " green", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: " hue", âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: â.â, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: null}], âmodelâ: âtext-davinci-003â} data: {âidâ: âcmpl-6ht5GQcXhhIcHKPflKQYvHegxMhjRâ, âobjectâ: âtext_completionâ, âcreatedâ: 1675917866, âchoicesâ: [{âtextâ: ââ, âindexâ: 0, âlogprobsâ: null, âfinish_reasonâ: âstopâ}], âmodelâ: âtext-davinci-003â} data: [DONE]
So, maybe I misunderstood you, @madhangopal500 (have been multitasking two IT coding projects and sanding teak wood floors as well)
You then, are not getting any errors, the issue is that your custom model does not perform as you expect?
Is that right?
@ruby_coder Yes, correct.
OK. Got it.
Please post back the first two lines of your JSONL fine-tuning file you used to fine-tune.
If possible, it would be good if you could wrap your data samples (here in the forum) with Markdown triple back ticks so your data and code is more easy to read.
```
Your data or code here.
```
{"prompt":"Item=handbag, Color=army_green, price=$99, size=S->", "completion":" This stylish small green handbag will add a unique touch to your look, without costing you a fortune."}
Text from Human: I want item of handbag and color as army green.
Expected Response is
This stylish small green handbag will add a unique touch to your look, without costing you a fortune.
$complete = $open_ai->completion([
'model' => 'davinci:ft-personal:infy7latest-2023-02-08-05-24-19',//custom model name
'prompt' => $prompt,
'temperature' => 0.7,
'max_tokens' => 256,
'top_p' => 1,
'frequency_penalty' => 0,
'presence_penalty' => 0,
'stream' => true
], function($curl_info, $data){
echo $data;
echo PHP_EOL;
ob_flush();
flush();
return strlen($data);
});
Yes, this JSON line entry (above) does not meet the OpenAI fine-tuning guidelines.
It seems almost everyone here skips reading this part of the docs, not only you @madhangopal500
Entire json line format has taken from Open AI documentation. Iâll re-check all JSON line.
Thanks for your help
Yes, that line is early in the document. Thatâs the problem with beta documentation. You are in the huge majority who stops at that example in the docs and missed the details posted above.
I have a working JSONL and OpenAI API fine-tuning validator and ran your JSONL line, and it passes (obviously) JSONL but fails the OpenAI âfine-tuning formatâ validator:
Could you share me any valid format which is accepted by Open AI?
That would be helpful for me.
I think something like this might work for you (not tested):
{"prompt":"Item=handbag, Color=army_green, price=$99, size=S-> MY_SEPARATOR", "completion":" This stylish small green handbag will add a unique touch to your look, without costing you a fortune. STOP_STOP"}
You must:
- Add a separator at the end of your prompt
- Add a stop at the end of your completion
- Have a white space at the beginning of your completion.
You must uses your separator and your stop when you query your fine-tuned model.
I think it is pretty clear from the directions below. Just follow the directions
The issue is that you expect to feed the API one of your prompts and are expecting it to find the matching completion.
Unfortunately, it doesnât work like that.
The fine-tuning changes the bias and establishes patterns for completions. It wonât work as a lookup table.
I also read that it doesnât like lists of parameters. It prefers things in sentences.
Eg.
âAn army green small handbag priced at $99â
will perform much better than
âItem=handbag, Color=army_green, price=$99, size=Sâ
But even with that change, it is not an exact science.
Essentially, you have to overwhelm the AI with patterns that it can follow. They could be lookup lists, but you will not get the matching completion for a given prompt. You would have to feed lots of examples for it to start to produce something similar.
@raymonddavey is 100% correct so even when you get all the formatting, separators and stops right, there are the challenges which @raymonddavey mentioned on top of all that.
Personally, I would not use fine-tuning for your application as you have shared; but since you only provided one example line of your JSONL file, I assumed you have many hundreds of training lines. Your choice of tech is different than mine, but you learn by experimenting!
So, go for it as you please. Experts are made my making a lot of mistakes or going down paths which lead to the wrong results; and finally âgetting it rightâ.
How many lines is your JSONL training file, BTW?
@ruby_coder as of now Iâm doing R&D so testing with two to three lines of JSON line. Iâll consider @raymonddavey points and work on it.
Iâll keep posted
You wonât get a fair indication of if it is going to work with only 2 or 3 lines.
You need at least 100. But if you canât do that, try 20 rows and increase n_epochs
n_epochs tell GPT to process the file multiple times. This reinforces learning.
Yeah, thatâs the fun part. Enjoy and report back with results, good and bad.
Hey @madhangopal500
FYI, in case you miss the docs on this, the n_epochs
parma defaults to 4. See:
See:
I think making sure you have your SEPARATOR and STOP set correctly in the training data and then using these these same strings in your prompts after tuning should help a lot, as the docs instruct.
I just tested your JSONL line @madhangopal500 against my validator for both JSONL and the API, as well:
Validated OK and got a ID no problem at all.
Iâm still working on adding more params to the fine-tune method, and may move the validator out completely as a separate function, add a second column for API valid?, etc⌠Itâs still a WIP.
HTH