DB-GPT-Hub icon indicating copy to clipboard operation
DB-GPT-Hub copied to clipboard

Hello, May I ask how I set max_sorce_length and max_target_length proper vaule?

Open JasonLLLLLLLLLLL opened this issue 1 year ago • 0 comments

The following is the two args in your code.

    max_source_length: Optional[int] = field(
        default=2048,
        metadata={
            "help": "The maximum total input sequence length after tokenization."
        },
    )
    max_target_length: Optional[int] = field(
        default=2048,
        metadata={
            "help": "The maximum total output sequence length after tokenization."
        },
    )

if I use an example as follows:

    {
        "db_id": "department_management",
        "instruction": "I want you to act as a SQL terminal in front of an example database, you need only to return the sql command to me.Below is an instruction that describes a task, Write a response that appropriately completes the request.\n\"\n##Instruction:\ndepartment_management contains tables such as department, head, management. Table department has columns such as Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees. Department_ID is the primary key.\nTable head has columns such as head_ID, name, born_state, age. head_ID is the primary key.\nTable management has columns such as department_ID, head_ID, temporary_acting. department_ID is the primary key.\nThe head_ID of management is the foreign key of head_ID of head.\nThe department_ID of management is the foreign key of Department_ID of department.\n\n",
        "input": "###Input:\nList the name, born state and age of the heads of departments ordered by age.\n\n###Response:",
        "output": "SELECT name ,  born_state ,  age FROM head ORDER BY age",
        "history": []
    },

max_source_length = len(instrcution)+len(input)+len(output)? max_target_length = len(output)? Here, len means the length of token, Am I right?

JasonLLLLLLLLLLL avatar Jan 06 '24 09:01 JasonLLLLLLLLLLL