schema consideration and warnings

#3
by nobitha - opened

Thank you for your model.
I have tested the model but the model sometimes did not consider the database schema when I gave the entire database , giving the inaccurate queries...
and
I got the below warning
warnings. warn(
Setting pad_token_id to eos_token_id:0 for open-end generation.

anyone can explain the above warning

Defog.ai org

Hi there! Thanks for trying out the model, and for your feedback.

Could you share the schema you shared with the model? For large databases, we typically use a pruning function, like the one here for the model to focus its attention better. We will release documentation for this pruning function tomorrow.

Are you using our colab notebook for inference? https://colab.research.google.com/drive/1z4rmOEiFkxkMiecAWeTUlPl0OmKgfEu7 You shouldn't get any warning messages with the following code:

eos_token_id = tokenizer.convert_tokens_to_ids(["```"])[0]
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
generated_ids = model.generate(
    **inputs,
    num_return_sequences=1,
    eos_token_id=eos_token_id,
    pad_token_id=eos_token_id,
    max_new_tokens=400,
    do_sample=False,
    num_beams=5
)
This comment has been hidden

Hey Hi ! Thank you for your response..

I have tried your colab it is good. Thank you for that but I have connected the entire database not only schema because i need both sql_query and results based on my database.
when I tried with a small-size database it gave a query and answer but when I used a large-size database it got below error.

RuntimeError: The size of tensor a (8192) must match the size of tensor b (28769) at non-singleton dimension 2

Is there any limitation for model ?

please consider the screenshots for both large and small databases.

Thanks !!!!

Screenshot from 2023-08-23 17-08-39.png

Screenshot from 2023-08-23 17-21-16.png

@rishdotblog I noticed you mentioned "For large databases, we typically use a pruning function, like the one here for the model to focus its attention better." Would it be possible for you to provide with some real-time examples. So, we can understand and follow it.

will the response quality increase if I send top 5 records along with the schema?

Sign up or log in to comment