Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对DeepSeek-Coder-V2-LIte sft之后输出会带上<|EOT|>然后一直打满 #183

Open
SamuelScc opened this issue Oct 24, 2024 · 0 comments

Comments

@SamuelScc
Copy link

对DeepSeek-Coder-V2-LIte sft之后输出会带上<|EOT|>然后一直打满

<|EOT|>
生成的单测代码是:
go
Copy
package init_prompt

import (
"testing"

"github.com/bytedance/mockey"
"github.com/smartystreets/goconvey/convey"

)

func TestGetRuleSkill(t *testing.T) {
// 预期覆盖分支行:18 (行号对应commit b606b43c)
t.Run("cover 18", func(t *testing.T) {
mockey.PatchConvey("case 01", t, func() {
ruleName := "rule1"
expectedSkill := "skill1"
RuleMetaInfos = map[string]*RuleMetaInfo{
ruleName: {
RuleSkill: expectedSkill,
},
}
skill := GetRuleSkill(ruleName)
convey.So(skill, convey.ShouldEqual, expectedSkill)
})
})

// 预期不进入分支
t.Run("no branch", func(t *testing.T) {
    mockey.PatchConvey("case 03", t, func() {
        ruleName := "rule3"
        expectedSkill := ""
        RuleMetaInfos = map[string]*RuleMetaInfo{
            ruleName: nil,
        }
        skill := GetRuleSkill(ruleName)
        convey.So(skill, convey.ShouldEqual, expectedSkill)
    })
})

}

<|EOT|>
<|EOT|>
<|EOT|>
<|EOT|>
<|EOT|>
<|EOT|>
<|EOT|>
<|EOT|>
<|EOT|>
<|EOT|>
<|EOT|>
<|EOT|>
<|EOT|>
<|EOT|>
<|EOT|>
<|tool▁call▁begin|>function<|tool▁sep|>GetRuleSkill
go
Copy
package init_prompt

import (
"testing"

"github.com/bytedance/mockey"
"github.com/smartystreets/goconvey/convey"

)

func TestGetRuleSkill(t *testing.T) {
// 预期覆盖分支行:18 (行号对应commit b606b43c)
t.Run("cover 18", func(t *testing.T) {
mockey.PatchConvey("case 1", t, func() {
// 模拟 RuleMetaInfos 中存在规则名对应的 RuleMetaInfo
RuleMetaInfos = map[string]*RuleMetaInfo{
"rule1": {
RuleSkill: "skill1",
},
}
res := GetRuleSkill("rule1")
convey.So(res, convey.ShouldEqual, "skill1")
})
})

}

<|EOT|>
<|EOT|>
<|tool▁call▁begin|>function<|tool▁sep|>GetRuleSkill
go
Copy
package init_prompt

import (
"testing"

"github.com/bytedance/mockey"
"github.com/smartystreets/goconvey/convey"

)

func TestGetRuleSkill(t *testing.T) {
// 预期覆盖分支行:18 (行号对应commit b606b43c)
t.Run("cover 18", func(t *testing.T) {
mockey.PatchConvey("case 01", t, func() {
ruleName := "rule1"
expectedSkill := "skill1"
RuleMetaInfos = map[string]*RuleMetaInfo{
ruleName: {
RuleSkill: expectedSkill,
},
}
skill := GetRuleSkill(ruleName)
convey.So(skill, convey.ShouldEqual, expectedSkill)
})
})

// 预期不进入分支
t.Run("no branch", func(t *testing.T) {
    mockey.PatchConvey("case 02", t, func() {
        ruleName := "rule2"
        expectedSkill := ""
        RuleMetaInfos = map[string]*RuleMetaInfo{
            ruleName: {
                RuleSkill: expectedSkill,
            },
        }
        skill := GetRuleSkill(ruleName)
        convey.So(skill, convey.ShouldEqual, expectedSkill)
    })
})

}
<|EOT|>
<|EOT|>
<|tool▁call▁begin|>function<|tool▁sep|>GetRuleSkill
go
Copy
package init_prompt

import (
"testing"

"github.com/bytedance/mockey"
"github.com/smartystreets/goconvey/convey"

)

func TestGetRuleSkill(t *testing.T) {
// 预期覆盖分支行:18 (行号对应commit b606b43c)
t.Run("cover 18", func(t *testing.T) {
mockey.PatchConvey("case 1", t, func() {
// 模拟 RuleMetaInfos 中存在规则名对应的 RuleMetaInfo
RuleMetaInfos = map[string]*RuleMetaInfo{
"rule1": {
RuleSkill: "skill1",
},
}
res := GetRuleSkill("rule1")
convey.So(res, convey.ShouldEqual, "skill1")
})
})

}
<|EOT|>
<|tool▁call▁begin|>function<|tool▁sep|>GetRuleSkill
go
Copy
package init_prompt

import (
"testing"

"github.com/bytedance/mockey"
"github.com/smartystreets/goconvey/convey"

)

func

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant