xtuner icon indicating copy to clipboard operation
xtuner copied to clipboard

[Feature] Hybrid Data Pipeline

Open pppppM opened this issue 1 year ago • 3 comments

pppppM avatar Mar 19 '24 20:03 pppppM

@fanqiNO1

pppppM avatar Mar 19 '24 20:03 pppppM

我做了一个 one-shot ,学着写一个,python解释器的样例,佬看一下对不对 @pppppM @fanqiNO1

[
    {
        "messages": [
            {
                "role": "user",
                "content": "帮我用scipy计算一个矩阵的逆"
            },
            {
                "role": "assistant",
                "content": "Sure, I will perform the matrix inversion using scipy.",
                "function_call": {
                    "name": "python_interpreter",
                    "parameters": {
                        "code": "import scipy.linalg\nscipy.linalg.inv([[1, 2], [3, 4]])"
                    }
                }
            },
            {
                "role": "function",
                "name": "python_interpreter",
                "content": "array([[-2. ,  1. ],\n       [ 1.5, -0.5]])"
            },
            {
                "role": "assistant",
                "content": "使用 scipy 计算出的矩阵的逆是 [[-2. , 1. ], [1.5, -0.5]]"
            }
        ],
        "functions": [
            {
                "name": "python_interpreter",
                "description": "Execute Python code and return the result",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "code": {
                            "type": "string",
                            "description": "Python code to be executed"
                        },
                        "required": ["code"]
                    }
                }
            }
        ]
    }
]

xiaohangguo avatar Mar 20 '24 07:03 xiaohangguo

@pppppM @LZHgrla code_interpreter_call的部分不用参与训练嘛? image

8c869fa845ae1330445aa292017eae5

xiaohangguo avatar Mar 27 '24 15:03 xiaohangguo