defog-ai / sqlcoder

SoTA LLM for converting natural language questions to SQL queries
Apache License 2.0
3.41k stars 218 forks source link

sqlcoder-7b-2 seems to be not good at calculating daily average #81

Closed rabum closed 9 months ago

rabum commented 9 months ago

Like I want it to write "sum(bal)/(date('2022-01-31')-date('2022-01-01')+1)" as daily average, but it just keeps writing "AVG(bal)", even though I told it in the question that you should do a division

rishsriv commented 9 months ago

Could you please share the full prompt you used? That will help us figure out what the issue is.

rabum commented 9 months ago

Could you please share the full prompt you used? That will help us figure out what the issue is.

I used the default prompt in the project, the q is "Select the total daily average deposit balance from January 1, 2022 to January 31" I have not found the effective prompt to make it write the intended answer

rishsriv commented 9 months ago

This is a reasonable answer for the question that you have asked. If you want it to be more specific, you can adapt the prompt with more specific instructions, by adding an instructions section to the prompt, like here or align it to specific reference examples, like here