Text to sql geneation not getting fast result

hello All
I develop API text to SQL for table schema and return m proper postgre SQL query. currently I am using three table schema. I tried both code-davinci-002 and text-devinci-002 model and use few short learning approach. I get Get best result from both model .
no any difference between this . I am using for this is on the AWS lamda function.
But I am Facing issue
some time when I enter general English text or new text which not available in few short its taking lots of time generating Query. I try everything unable to solve. not getting response fast.
any one pls suggest .