CodeFuse-MFTCoder提升Qwen-14B代码能力

fuse初使用-eins fuse的github及介绍 fuse-github fuse-wiki-zh meson;ninja wget + tar 得到fuse源代码(我下载的是3.10.5),发现没有自己熟悉的configure、makefile,傻眼了 一度以为自己下载的压缩包有问题,是不是贡献者忘了??(无比自信的我) 对比了几版之后,我发现meson.build这个小东西 meson 提供一种支持并行的编译环境,把他当成makefile的替代品就可以了;至于ninja,在这里是meson的默认后端 。 可惜的是,我 阅读详情

CodeFuse-MFTCoder 项目地址:

https://github.com/codefuse-ai/MFTCoder

CodeFuse-Qwen-14B 模型地址:

https://huggingface.co/codefuse-ai/CodeFuse-QWen-14B

CodeFuse-QWen-14B

一、Qwen-14B底座代码能力总览

Qwen(通义千问)是阿里云开源的大型语言模型集合,目前有两个参数规模的模型:Qwen-7B和Qwen-14B。

Qwen在LLama框架的基础上增加了以下特性:

  1. 词表:在原有的110k个词基础上,加入了中文字符和单词,并将数字按照0-9分别添加到词表中,最终词表大小为152K。
  2. 输入嵌入:没有绑定输入嵌入和输出投影的权重。
  3. 位置嵌入:使用RoPE进行位置嵌入,并选择了FP32精度,而不是BF16或FP16,以获得更好的表现。
  4. 偏置:除了注意力层的QKV层外,其他层中的偏置被去除。
  5. RMSNorm:使用RMSNorm替代常用的LayerNorm,因为RMSNorm更高效。
  6. 激活函数:选择了SwiGLU作为激活函数。
  7. FFN层:将常用的4倍隐藏维度换成了8/3倍隐藏维度。
  8. 扩展长度:通过NTK-aware插值和LogN-Scaling将令牌长度扩展到8092,同时保证了对高频信息和长程依赖的建模。

Qwen官方透出的评测,在各项能力上都超过了同等大小的开源大语言模型,包括LLaMA,LLaMA2,ChatGLM2,Baichuan2,InternLM等。详细的对比可以参考下图,该图中绿色绿色实线表示是其他开源模型在该项能力上取得最高分数。

图1:Qwen能力分布雷达图以及和其他模型的对比(截取至Qwen的技术报告)

同时,在代码能力上,我们结合官方的评测在python、java、javascript、c++、go等几种语言上,和其他模型进行了对比。

表1:Qwen-14B 和 其他模型代码补全能力对比。

模型

Python

Java

Java Script

C++

Go

均值

Qwen-14B

32.93%

35.37%

32.93%

30.49%

21.34%

30.61%

Baichuan2-13B

17.1%

20.73%

5.49%

16.45%

6.71%

13.30%

CodeGeeX2-6B

35.90%

30.80%

32.20%

29.30%

22.50%

30.14%

StarCoder-15B

33.57%

30.22%

30.79%

31.55%

17.62%

28.75%

CodeLLama-13B

43.29%

41.46%

38.41%

34.76%

29.27%

37.44%

从上面,我们可以看出Qwen-14B的代码能力远高于同尺寸的自然语言大模型Baichuan2-13B,甚至可以和专门的代码大模型(比如CodeGeeX2、StarCoder)媲美。但CodeLLama的在代码方面的表现还是优于Qwen,可能是由于CodeLLama在LLama2的基础上进行了代码的加训。另外,我们注意到,Qwen也有一个专用于代码任务的版本叫做Code Qwen。和CodeLLama一样,Code Qwen也用了大量代码数据对Qwen进行了加训。Code Qwen暂时没有开源,我们期待看到Code-Qwen在代码上更优越的表现。

二、CodeFuse-MFTCoder 多任务微调Qwen-14B

借助CodeFuse-MFTCoder的多任务微调能力,我们可以使用多个代码任务数据集对Qwen-14B进行多任务微调(MFT)。在任务选择上,我们精选了6个核心代码任务数据,即代码补全(Code Completion),代码生成(Text2Code), 代码翻译(Code Translation),单测生成(Unittest Generation),SQL生成(Text2Sql), 报错修复(Exception Retry),一共110w条指令问答数据。

训练采用MFTCoder的多任务QLoRA(4bit量化)微调模式, 相应的配置如下:

{
    "lora_rank": 96,
	"lora_alpha": 32,
	"lora_dropout": 0.05,
	"targeting_modules": ["c_proj", "c_attn", "w1", "w2"]
}

对以上数据进行了约4个Epoch的训练到收敛。训练过程loss情况如下图所示。

通过多任务微调,CodeFuse-Qwen-14B的各方面代码能力均有比较大的提升。

三、CodeFuse-Qwen-14B模型效果

接下来看一些Qwen-14B-MFT微调后的模型的生成效果。在代码补全/代码翻译/代码修复/SQL生成/单元测试生成等代码任务上有较好表现,更丰富的生成样例,请看下面详细展示。
 

代码生成(Code Completion / Text2Code)

MFT后的Qwen-14B有更好的代码生成能力。在五种编程语言的代码补全测试集HumanEval-x上进行了相关评测(见表2),测试结果显示与Baichun2-13B-Base、Qwen-14B-Base、CodeGeex2-6B、StarCoder-15B等模型相比,微调后的Qwen-14B-MFT在Java/Python/Cpp/JavaScript均是Top1,相对于底座平均提升10%+。和剩余的模型里面表现最好的CodeLLama,其中JavaScript语言提升效果最明显(38.41%->46.34%),pass@1指标均值提升2.92%(37.44%-40.36%):

表2:CodeFuse-Qwen-14B和其他模型代码补全能力对比

模型

Python

Java

JavaScript

C++

Go

均值

CodeFuse-Qwen-14B

48.78%

41.46%

46.34%

38.41%

26.83%

40.36%

Qwen-14B

32.93%

35.37%

32.93%

30.49%

21.34%

30.61%

Baichuan2-13B

17.1%

20.73%

5.49%

16.45%

6.71%

13.30%

CodeGeeX2-6B

35.90%

30.80%

32.20%

29.30%

22.50%

30.14%

StarCoder-15B

33.57%

30.22%

30.79%

31.55%

17.62%

28.75%

CodeLLama-13B

43.29%

41.46%

38.41%

34.76%

29.27%

37.44%

与此同时,MFTcoder也让Qwen-14B在自然语言的任务上有了一些提升,可能是由于代码类任务对于提升自然语言的逻辑推理能力是有帮助的。

表3:CodeFuse-Qwen-14B 和 底座模型Qwen-14B 在自然语言能力上对比

模型/测试集

COPA: 

因果推断

C3: 中文阅读理解

CLS: 中文科技文献

AFQMC: 金融句子相似度

Ax-b: 逻辑关系推理

RTE: 

逻辑关系

CodeFuse-Qwen-14B

95

91.1

68.5

71.99

67.84

76.53

Qwen-14B

93

90.8

54.4

69

49.5

71.50

GPT-4

98

90.6

65

58.2

68.3

80.9

以下是多语言代码补全 & Text2Code任务上的具体样例:

代码补全(Code Completion )

Python

Question: 

from typing import List


def filter_by_substring(strings: List[str], substring: str) -> List[str]:
    """ Filter an input list of strings only for ones that contain given substring
    >>> filter_by_substring([], 'a')
    []
    >>> filter_by_substring(['abc', 'bacd', 'cde', 'array'], 'a')
    ['abc', 'bacd', 'array']
    """

Answer:

     return [s for s in strings if substring in s]

Question:

from typing import List


def below_zero(operations: List[int]) -> bool:
    """ You're given a list of deposit and withdrawal operations on a bank account that starts with
    zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
    at that point function should return True. Otherwise it should return False.
    >>> below_zero([1, 2, 3])
    False
    >>> below_zero([1, 2, -4, 5])
    True
    """

Answer:

     balance = 0 for op in operations: balance += op if balance < 0: return True return False 

C++

Question: 

/*
You"re given a vector of deposit and withdrawal operations on a bank account that starts with
zero balance. Your task is to detect if at any point the balance of account falls below zero, and
at that point function should return true. Otherwise it should return false.
>>> below_zero({1, 2, 3})
false
>>> below_zero({1, 2, -4, 5})
true
*/
#include<stdio.h>
#include<vector>
using namespace std;
bool below_zero(vector<int> operations){

Answer:

int balance = 0; for(int i=0; i<operations.size(); i++){ balance += operations[i]; if(balance < 0){ return true; } } return false; } 

Question: 

/*
Filter an input vector of strings only for ones that contain given substring
>>> filter_by_substring({}, "a")
{}
>>> filter_by_substring({"abc", "bacd", "cde", "vector"}, "a")
{"abc", "bacd", "vector"}
*/
#include<stdio.h>
#include<vector>
#include<string>
using namespace std;
vector<string> filter_by_substring(vector<string> strings, string substring){

Answer:

 vector<string> filtered_strings; for(string s : strings){ if(s.find(substring) != string::npos){ filtered_strings.push_back(s); } } return filtered_strings; }

Java

Question: 

import java.util.*;
import java.lang.*;

class Solution {
    /**
    You're given a list of deposit and withdrawal operations on a bank account that starts with
    zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
    at that point function should return True. Otherwise it should return False.
    >>> belowZero(Arrays.asList(1, 2, 3))
    false
    >>> belowZero(Arrays.asList(1, 2, -4, 5))
    true
     */
    public boolean belowZero(List<Integer> operations) {

Answer:

int balance = 0; for (int op : operations) { balance += op; if (balance < 0) { return true; } } return false; } } 

Question: 

import java.util.*;
import java.lang.*;

class Solution {
    /**
    Filter an input list of strings only for ones that contain given substring
    >>> filterBySubstring(List.of(), "a")
    []
    >>> filterBySubstring(Arrays.asList("abc", "bacd", "cde", "array"), "a")
    ["abc", "bacd", "array"]
     */
    public List<String> filterBySubstring(List<String> strings, String substring) {

Answer:

List<String> filteredStrings = new ArrayList<>(); for (String str : strings) { if (str.contains(substring)) { filteredStrings.add(str); } } return filteredStrings; } } 

JavaScript

Question: 

/* You're given a list of deposit and withdrawal operations on a bank account that starts with
  zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
  at that point function should return true. Otherwise it should return false.
  >>> belowZero([1, 2, 3])
  false
  >>> belowZero([1, 2, -4, 5])
  true
  */
const belowZero = (operations) => {

Answer:

let balance = 0; for (let i = 0; i < operations.length; i++) { balance += operations[i]; if (balance < 0) { return true; } } return false; }; 

Question: 

/* Filter an input list of strings only for ones that contain given substring
  >>> filterBySubstring([], 'a')
  []
  >>> filterBySubstring(['abc', 'bacd', 'cde', 'array'], 'a')
  ['abc', 'bacd', 'array']
  */
const filterBySubstring = (strings, substring) => {

Answer:

return strings.filter(string => string.includes(substring)); }; 

Go

Question: 

// You're given a list of deposit and withdrawal operations on a bank account that starts with
// zero balance. Your task is to detect if at any point the balance of account fallls below zero, and
// at that point function should return true. Otherwise it should return false.
// >>> BelowZero([1, 2, 3])
// false
// >>> BelowZero([1, 2, -4, 5])
// true
func BelowZero(operations []int) bool {

Answer:

balance := 0 for _, op := range operations { balance += op if balance < 0 { return true } } return false } 

Question: 

import (
    "fmt"
)

// Input are two strings a and b consisting only of 1s and 0s.
// Perform binary XOR on these inputs and return result also as a string.
// >>> StringXor('010', '110')
// '100'
func StringXor(a string, b string) string {

Answer:

var result string for i := 0; i < len(a); i++ { if a[i] != b[i] { result += "1" } else { result += "0" } } return result 

Text2Code 测试

摘录一些Python测试cases,模型不论在中文还是英文生成代码指令表现都比较优秀,摘录部分cases如下

Python-中文

Question:

"写一个函数来查找一个给定的整数数组是否包含任何重复的元素"

这是一个使用Python语言的函数,它使用了Python的内置数据结构集合(set)来查找重复元素.集合的特性是元素是唯一的,所以如果一个元素在集合中已经存在,它将被忽略,否则它将被添加到集合中.如果集合的长度大于0,则表示存在重复元素.

def has_duplicate(nums):
    return len(set(nums)) != len(nums)

这个函数首先将整数数组转换为一个集合,然后比较集合的长度和原始数组的长度.如果它们不相等,则说明存在重复元素,函数返回True.否则,函数返回False.

例如,对于数组[1, 2, 3, 4, 5],函数将返回False,因为没有重复元素.对于数组[1, 2, 2, 3, 4, 5],函数将返回True,因为存在重复元素2.

Python-英文

Question:

"Write a python function to find the product of non-repeated elements in a given array."

Here is a Python function that solves the problem: 

```python def find_Product(arr, n): product = 1 for i in range(n): if arr[i] not in arr[:i] and arr[i] not in arr[i+1:]: product *= arr[i] return product ``` 

This function works by iterating over the array and checking if the current element is not repeated in the array. If it is not, it multiplies the current element to the product. The `not in` operator is used to check if an element is not in a list. The `arr[:i]` and `arr[i+1:]` are used to check if the element is not repeated before and after the current index respectively. The function returns the product of all non-repeated elements in the array. The time complexity of this function is O(n^2) because for each element in the array, we are checking if it is not repeated in the array. The space complexity is O(1) because we are not using any extra space that scales with the input size. 

单元测试生成(Unittest Generation)

模型可以根据prompt生成函数对应的测试单元,以下是生成单元测试的例子,这些单测是经过人工验证通过的cases:

python单元测试生成

Question:

为以下Python代码生成单元测试

def total_match(lst1, lst2):
    l1 = 0
    for st in lst1:
        l1 += len(st)

    l2 = 0
    for st in lst2:
        l2 += len(st)

    if l1 <= l2:
        return lst1
    else:
        return lst2

Answer:

import unittest

class TestTotalMatch(unittest.TestCase):

    def test_equal_length(self):
        # 测试两个列表长度相等的情况
        lst1 = ["abc", "def", "ghi"]
        lst2 = ["abc", "def", "jkl"]
        self.assertEqual(total_match(lst1, lst2), lst1)

    def test_different_length(self):
        # 测试两个列表长度不相等的情况
        lst1 = ["abc", "def", "ghi"]
        lst2 = ["abc", "def"]
        self.assertEqual(total_match(lst1, lst2), lst2)

    def test_empty_list(self):
        # 测试两个列表都为空的情况
        lst1 = []
        lst2 = []
        self.assertEqual(total_match(lst1, lst2), lst1)


if __name__ == "__main__":
    unittest.main()

Question:

为以下Python代码生成单元测试
def add_elements(arr, k):
    return sum(elem for elem in arr[:k] if len(str(elem)) <= 2)

Answer:

import unittest

class TestAddElements(unittest.TestCase):
    def test_add_elements_with_k_0(self):
        # 测试当k为0时,返回0
        arr = [1, 2, 3, 4, 5]
        k = 0
        result = add_elements(arr, k)
        self.assertEqual(result, 0)

    def test_add_elements_with_k_1(self):
        # 测试当k为1时,返回1
        arr = [1, 2, 3, 4, 5]
        k = 1
        result = add_elements(arr, k)
        self.assertEqual(result, 1)

    def test_add_elements_with_k_2(self):
        # 测试当k为2时,返回1+2=3
        arr = [1, 2, 3, 4, 5]
        k = 2
        result = add_elements(arr, k)
        self.assertEqual(result, 3)

if __name__ == '__main__':
    unittest.main()

代码翻译(Code Translation)

除了代码生成,模型在多种常用编程语言下的代码翻译任务上有相当好的表现,例如:C++ <-> Python / Python<->Java / Java<->C++,以下展示更加详细的代码翻译示例:

代码翻译相关Cases 展示

C++->Python 

Question: 

# Translate the following C++ program to Python
# C++
#include<stdio.h>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
#include<stdlib.h>
int hex_key(string num){
    string key="2357BD";
    int out=0;
    for (int i=0;i<num.length();i++)
        if (find(key.begin(),key.end(),num[i])!=key.end()) out+=1;
    return out;
}
# Python

Answer: 

def hex_key(num):
    key = "2357BD"
    out = 0
    for i in range(len(num)):
        if num[i] in key:
            out += 1
    return out

Python->C++

Question: 

# Translate the following Python program to C++
 # Python
def check_Validity(a,b,c):  
    if (a + b <= c) or (a + c <= b) or (b + c <= a) : 
        return False
    else: 
        return True        
# C++
/**
* The result code must follow this signature:
* bool checkValidity(int a, int b, int c) 
*/

Answer: 

bool checkValidity(int a, int b, int c) {
    if (a + b <= c || a + c <= b || b + c <= a) {
        return false;
    } else {
        return true;
    }
}

代码修复(Excpetion Retry)

除了上述代码补全/代码翻译等代码生成任务之外,微调后的MFT模型在代码修复上表现也相当优秀,为了评测模型在代码修复上的结果,从StackOverflow上摘录部分数据作为测试,以此展示模型的修复代码能力,具体cases展示如下:

Question:

# 除数为0时会抛出ZeroDivisionError异常
x = 10
y = 0
result = x / y  # 在这里会出现ZeroDivisionError异常
print(result)

以上代码报错如下,请根据报错信息修复代码:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ZeroDivisionError: division by zero

Answer:

代码中除数为0,导致了ZeroDivisionError异常.应该在除数为0之前添加判断语句,避免除数为0的情况发生.
以下是修复后的代码:

# 添加判断语句,避免除数为0的情况
x = 10
y = 0
if y != 0:
    result = x / y
    print(result)
else:
    print("除数不能为0")

Question:

# 生成一个长度为10的列表
my_list = [i for i in range(10)]

# 对这个列表进行排序,但是使用了错误的参数
sorted_list = sorted(my_list, key=lambda x: 1/x)

以上代码报错如下,请根据报错信息修复代码:

Traceback (most recent call last):
 File "<stdin>", line 4, in <module>
ZeroDivisionError: division by zero

Answer:

以下是修复后的代码:

# 生成一个长度为10的列表
my_list = [i for i in range(10)]

# 对这个列表进行排序,但是使用了错误的参数
sorted_list = sorted(my_list, key=lambda x: 1/x if x!=0 else 0)

SQL生成(Text2Sql)

模型在简单以及复杂SQL生成上表现不错,在多表JOIN ON、 INTERSECT、GROUP BY、LIKE、ORDER BY、DISTINCT、COUNT、LIMIT以及MAX/MIN/</>/=等常用SQL语法上,也能准确生成解析&语法完全正确的SQL语句,以下是一些具体的SQL生成cases:

Question: 

You are a professional SQL engineer and you are writing SQL queries for data query tasks.\n\nWhat are the medicine and trade names that can interact as an inhibitor and activitor with enzymes?\nschema:medicine(id|name|Trade_Name|FDA_approved),medicine_enzyme_interaction(enzyme_id|medicine_id|interaction_type)

Answer: 

"SELECT T1.name ,  T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id WHERE interaction_type  =  'inhibitor' INTERSECT SELECT T1.name ,  T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id  =  T1.id WHERE interaction_type  =  'activitor' "

Question: 

You are a professional SQL engineer and you are writing SQL queries for data query tasks.\n\nHow many schools are in the basketball match?\nschema:basketball_match(Team_ID|School_ID|Team_Name|ACC_Regular_Season|ACC_Percent|ACC_Home|ACC_Road|All_Games|All_Games_Percent|All_Home|All_Road|All_Neutral)

Answer:

SELECT count(DISTINCT school_id) FROM basketball_match\n'

Qestion:

You are a professional SQL engineer and you are writing SQL queries for data query tasks.\n\nWhat is the primary conference of the school that has the lowest acc percent score in the competition?\nschema:university(School_ID|School|Location|Founded|Affiliation|Enrollment|Nickname|Primary_conference),basketball_match(Team_ID|School_ID|Team_Name|ACC_Regular_Season|ACC_Percent|ACC_Home|ACC_Road|All_Games|All_Games_Percent|All_Home|All_Road|All_Neutral)

Answer:

'SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t2.acc_percent LIMIT 1\n'

Qestion:

You are a professional SQL engineer and you are writing SQL queries for data query tasks.\n\nWhat are the different affiliations, and how many schools with each have an enrollment size of above 20000?\nschema:university(School_ID|School|Location|Founded|Affiliation|Enrollment|Nickname|Primary_conference)

Answer:

'SELECT count(*) ,  affiliation FROM university WHERE enrollment  >  20000 GROUP BY affiliation', 'predict': 'SELECT affiliation ,  count(*) FROM university WHERE enrollment  >  20000 GROUP BY affiliation\n'

Qestion:

You are a professional SQL engineer and you are writing SQL queries for data query tasks.\n\nReturn the maximum enrollment across all schools.\nschema:university(School_ID|School|Location|Founded|Affiliation|Enrollment|Nickname|Primary_conference)

Answer: 

'SELECT max ( enrollment ) FROM university

问题:
You are a professional SQL engineer and you are writing SQL queries for data query tasks.\n\n麻烦请问一下成交住宅建筑面积大于 50万平米并且成交楼面地价大于 3000元\\/平米的成交住宅土地宗数最小是多少?\nschema:Table_5a4edf57312b11e9b253542696d6e445(时间|成交住宅土地宗数|成交住宅建筑面积万平米|成交楼面地价元_平米|溢价率)

回答:

'SELECT MIN(成交住宅土地宗数) FROM Table_5a4edf57312b11e9b253542696d6e445 WHERE 成交住宅建筑面积万平米 > 50 AND 成交楼面地价元_平米 > 3000'

问题:You are a professional SQL engineer and you are writing SQL queries for data query tasks.\n\n你好,容积率大于1的楼盘里平均卖价最低的是多少钱\nschema:Table_c9896f30332111e98b80542696d6e445(楼盘|楼盘均价|楼盘容积率|楼盘装修标准|价格比较)

回答:

'SELECT MIN(楼盘均价) FROM Table_c9896f30332111e98b80542696d6e445 WHERE 楼盘容积率 > 1'

其他示例

除了代码相关指令,微调后的模型在中英文翻译,基础QA问答,文本生成等任务上也有比较好的表现,可以通过下载模型生成更丰富的生成样例,以下是一些日常对话问答的例子,未经过筛选:

Q: 请你写一个大熊猫和小兔子之间的故事,字数限制在50字以内

A: 大熊猫和小兔子一起玩耍, 大熊猫教小兔子爬树, 小兔子教大熊猫跳舞. 他们成为了好朋友.

Q:把李白的《静夜思》翻译成英文

A:

床前明月光,

疑是地上霜.

举头望明月,

低头思故乡.

Thoughts on a Quiet Night

Bright moonlight before my bed,

I suspect it is frost on the ground.

I lift my head and gaze at the bright moon,

Then lower it, missing my hometown.

Q:你可以解释下牛顿第三定律吗

A:

当两个物体相互作用时,彼此之间的作用力大小相等,方向相反,作用在同一直线上.这就是牛顿第三定律.换句话说,对于每一个作用力,都有一个相等而反向的反作用力.

Q:天津是中国的首都吗?

A:No, 天津不是中国的首都.中国的首都是北京.

Q:给自己许久不见的老师写一封邮件,问候他的情况

A:

Dear [Teacher's Name],

It's been a long time since we last spoke, and I hope this email finds you well. I wanted to take a moment to reach out and say hello, and to express my gratitude for all that you've done for me over the years.

I remember how much I appreciated your dedication to teaching and your passion for your subject matter. Your classes were always engaging and thought-provoking, and I learned so much from you. I also appreciated your patience and understanding, especially during those times when I struggled with the material.

I've been keeping up with some of the news about your work and your research, and I'm impressed by all that you've accomplished since we last spoke. I'm sure you're still making a difference in the lives of your students and in the field of [your teacher's field of expertise].

I hope you're doing well and that you're enjoying your time away from the classroom. Please let me know if there's anything I can do to help or if you'd like to catch up sometime.

Best regards,

[Your Name]

一些现象:虽然对话整体流畅,但是有时候会出现中文问,英文答的问题,但这也是大模型的通病,应该与基座模型使用多种语言数据预训练有关,可以通过prompt指令指定目标语言来解决这类问题,当然后续也可以根据微调优化这类问题。

Qwen最新开源14B,同级别SOTA,github页面 通过arXiv数据集上的语言模型实验,我们的原生长度为2K的Qwen-7B/14B在8K的序列长度下依然表现不错,而原生长度扩展到8K的Qwen-7B能够在32K长序列的设置下取得不错的表现。在此基础上,我们针对LLM对接外部系统等方面针对性地做了优化,当前具备较强的工具调用能力,以及最近备受关注的Code Interpreter的能力和扮演Agent的能力。尤其注意,你需要在脚本中指定正确的模型名称或路径、数据路径、以及模型输出的文件夹路径。在他的领导下,公司迅速发展起来,成为了一家成功的科技企业。 阅读详情

相关推荐

基于NE555的触摸延时开关电路设计与实现

本文详细介绍了基于NE555芯片的触摸延时开关电路设计与实现方法。通过分析NE555的单稳态工作模式,结合定时电阻、电解电容等关键元件选型,提供了一套完整的电路搭建方案。文章还包含抗干扰设计、调试技巧及常见故障处理,帮助电子爱好者快速掌握触摸延时灯的制作要点。

weixin_29268267的博客 802

「CodeFuse」CodeFuse简介及项目应用实战

CodeFuse 是一款为国内开发者提供智能研发服务的产品,该产品是基于蚂蚁集团自研的基础大模型进行微调的代码大模型,旨在辅助开发者提高编码效率和代码质量。它提供了多项功能,包括辅助编码、代码优化和生成单测。通过海量数据提供实时的代码补全服务,包括行内补全和片段补全,并支持解释代码、生成注释等功能,帮助开发者快速完成功能研发,提高研发效率。此外,CodeFuse 还能对选定的代码段进行分析理解,提出优化和改进建议,并能直接基于改进建议形成代码补丁,帮助开发者写出更好的代码。

GIS摆渡人 1万+

激光可燃气体传感器:核心技术环节分析

激光可燃气体传感器核心技术涵盖七个维度:1)TDLAS光谱吸收与调制技术(检测下限ppm级);2)DFB激光器与双闭环温控系统(波长稳定性±0.0036nm);3)微弱信号处理技术(信噪比提升60dB);4)环境补偿算法(温压补偿误差<±1%);5)本质安全防爆设计(ExiaIICT4Ga等级);6)智能边缘计算(STM32L476芯片);7)多重性能验证(响应时间<1秒)。通过微型化、多气体检测等创新,该技术已在工业安全等领域替代传统方案,实现高精度检测。(149字)

上市公司前技术负责人,20 年软硬件深耕 + 百人研发团队管理经验,名校理工科背景加持。从技术攻坚到团队掌舵,沉淀海量项目实战与管理心得,专注分享软硬件干货、疑难问题解决方案,既是靠谱知识传播者,也盼链接优质项目共成长。 1056

配置 服务器安装code-server 并通过ip+端口 访问

服务器安装code-server npm i code-server -g 编辑配置文件 vim ~/.config/code-server/config.yaml 修改 或添加 bind-addr: 0.0.0.0:8082 再次启动 code-server 输入配置文件中的密码 进入 首页

知无涯 7977

Scrapy实现微博关键词爬虫(爬虫结果写入mongodb)

话不多说,上代码: spiders文件夹下的microBlogSpider.py里这样写: # -*- coding: utf-8 -*- import scrapy from scrapy import Spider, Request, FormRequest from scrapy.selector import Selector import datetime import random from blogSpider.items import microBlogItem, keyWordItem f

qq_39360565的博客 1785

UNet改进(12):融合小波变换与注意力机制的图像分割新方法

本文提出了一种改进的WaveletAttentionUNet架构,通过结合小波变换和注意力机制来增强传统UNet的多尺度特征提取能力。该网络使用分组卷积模拟小波分解,将输入通道扩展为4个子带(LL、LH、HL、HH),并通过通道注意力机制自适应加权各子带特征。网络保留了UNet的编码器-解码器结构,在关键位置集成了WaveletAttention模块。实验证明该方法在医学图像分割等任务中能更好地保持边缘细节和复杂纹理特征,同时保持计算效率。

2501_91516851的博客 764

CodeFormer 安装

2.执行python开头的命令时,把[input folder]整体替换成待处理的图片所在的文件夹路径。整体图像和视频增强同理,都是把[]替换成路径。1.每次使用前都要先进入cmd,执行cd CodeFormer,进入安装目录后再执行对应命令。,并将其放到weights/CodeFormer下(如果不行,可以用下面的命令),并将其放到weights/facelib下(如果不行,可以用下面的命令)图片修复、去水印、黑白还原为彩色等功能。4.w为保真度,取值为0到1。3.结果在result里面。

GodGump的博客 2万+

在 ABAP RAP 草稿模式中实现校验与 State Message:从业务规则到 Fiori 体验的全链路实践

本文深入探讨了SAP RAP框架中草稿业务对象的校验与消息机制,重点分析了validation、state message和transition message的应用场景及实现方法。文章指出,RAP校验机制可确保草稿数据的完整性,通过即时反馈防止错误数据进入激活态。同时详细比较了两类消息:state message(持久化)和transition message(临时性)的特点与适用场景。作者结合旅游预订案例,展示了如何在数据模型、行为定义和行为实现中配置校验规则,并给出工程实践中的常见误区与解决方案,如避

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 204

CodeFuse-MFTCoder 配 TaoToken:Qwen-14B 代码能力增强的 config.toml 骨架与验证

CodeFuse-MFTCoder 接 TaoToken 通道验证 Qwen-14B 代码能力,本文给出可复制的 config.toml 骨架:配置 api_base、api_key_env 与并发重试参数,先跑通单条代码补全请求,再逐步开启多任务评测。官网 https://taotoken.net/?utm_source=taotoken_aicg_blog_end

WhiteTiger78的博客 140

[Dify] 法律文档解析助手怎么做才敢用?先把条款提取、依据核对和人工复核分开

这篇文章围绕用 Dify 搭建法律文档解析助手时最容易被忽略的可靠性问题展开:文档能上传、模型能总结,并不等于结果就能直接用于法务判断。文章会从文档抽取、条款定位、召回片段核对、结构化输出和人工复核几个角度梳理设计思路,适合正在用 Dify 处理合同、制度、招投标文件或企业知识库问答的读者阅读。

技术小甜甜:传播可落地技术,帮助个人和企业降低解决真实场景问题的成本 9382

【GameFramework框架内置模块】17、声音(Sound)

声音(Sound)模块是管理音频的模块,比如播放、停止、修改音量等,支持淡入淡出、AudioMixer等高级设置。声音(Sound)的配置面板如下所示:所有的声音统一按照组来分,可以根据需要添加或者溢出组,声音组可以配置Agent的数量和音量等。

CSDN博客专家,Unity3D高级软件工程师,《Unity 3D从入门到实战》作者。 1921

CodeFuse多任务微调框架MFTCoder实战:如何用少量数据提升开源大模型的代码能力

本文详细介绍了CodeFuse多任务微调框架MFTCoder如何通过创新的多任务联合训练机制,仅需少量高质量数据即可显著提升开源大模型的代码能力。文章解析了MFTCoder的动态损失平衡算法、高效数据打包技术和混合精度训练优化等核心设计,并提供了从数据准备到模型微调、评估及部署的完整实战指南,帮助开发者高效提升模型在HumanEval等基准上的表现。

weixin_30797199的博客 401

Android 12.0 SystemUI下拉状态栏定制化之隐藏下拉通知栏布局功能实现(二)

在12.0的系统定制化开发中,由于从12.0开始SystemUI下拉状态栏和11.0的变化比较大,所以可以说需要从新分析相关的SystemUI的 布局,然后做分析来实现不同的功能,今天就开始实现关于隐藏SystemUI下拉状态栏中的通知栏布局系列二,去掉下拉状态栏中 通知栏部分 白色的圆角背景

安卓兼职framework和app工程师的博客 1638

MFTCoder论文被KDD 2024接收,开源v0.4.2版发布

CodeFuse在2023年9月开源了一种多任务微调框架——MFTCoder,它可以实现在多个任务上同时并行地进行微调。通过结合多种损失函数,我们有效地解决了多任务学习中常见的任务间数据量不平衡、难易不一和收敛速度不一致等挑战。大量实验结果显示,相较于单独对单个任务进行微调或者多任务混合为一后进行微调,我们的多任务微调方法表现更优。此外,MFTCoder具备高效训练特征,包括提供高效的数据Tokenization模式,支持PEFT微调和全量微调,能有效提升微调训练速度并降低对资源的需求。

CodeFuse的博客 1115

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

CodeFuse成功支持通义千问算法大赛,评测方案已开源

前段时间, 首届通义千问AI挑战赛成功举办,CodeFuse 为大赛提供技术支持,模型微调框架 MFTCoder 和 CodeFuseEval 评测框架为大赛保驾护航,助力大赛圆满完成。我们基于leetcode 阿里和蚂蚁最新面试题库建设了“模型赛马”在线打榜的评测方案,目前验证集已作为 CodefuseEval 的一项任务在 Github 上开放,欢迎大家下载使用。

CodeFuse的博客 1456

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

CodeFuse-MFTCoder 提升 CodeGeeX2-6B 代码能力

CodeFuse-MFTCoder 项目地址:GitHub - codefuse-ai/MFTCoder: High Accuracy and efficiency multi-task fine-tuning framework for Code LLMs CodeFuse-Codegeex2-6B 模型地址:https://modelscope.cn/models/codefuse-ai/CodeFuse-CodeGeeX2-6B https://huggingface.co/codefuse-ai/C

CodeFuse的博客 842

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

CodeFuse--AI代码辅助编程工具开盒尝鲜

生成式人工智能在编码方面表现出的学习和适应能力令人非常兴奋,本文将为读者率先开盒尝试CodeFuse,供大家学习和借鉴!(邀请码:【552049】)

Glory_Sunshine的博客 3229

蚂蚁智能研发助手CodeFuse来了!支持40余种编程语言

祝各位开发者节日快乐!今天,在这个特殊的日子里,我为大家带来一份小礼物——蚂蚁出品的智能研发助手 CodeFuse~今年,互联网最热门的话题之一,就是以 ChatGPT 为代表的“生成式 AI”,而对程序员来说,则是 AI 辅助编程工具的兴起。最近,国内也涌现出许多智能编码助手。现在,蚂蚁也为大家带来了自己的 AI 研发助手 CodeFuse!我们荣幸地邀请您参与CodeFuse 插件的邀请内测,报名并审核通过后即可免费下载使用,快来试试吧~

CodeFuse的博客 4285

2025年CodeFuse任务认领的5大关键步骤(专家级操作指南)

掌握2025年CodeFuse任务认领流程2025,轻松提升开发效率。本文详解任务发布、权限申请、智能匹配、进度追踪与自动验收五大步骤,适用于开源协作与企业级研发场景。方法权威,流程清晰,助你高效参与项目贡献,值得收藏。

Instrulink的博客 432

CodeFuse-Query 开源项目使用教程

CodeFuse-Query 开源项目使用教程 1. 项目的目录结构及介绍 CodeFuse-Query 项目的目录结构如下: CodeFuse-Query/ ├── docs/ │ ├── README.md │ └── ... ├── src/ │ ├── main/ │ │ ├── java/ │ │ └── resources/ │ └── test/ │ ...

gitblog_01080的博客 505

在 Visual Studio Code 中使用 CodeFuse

Visual Studio Code作为一款广受程序员欢迎的代码编辑器,在前端开发和各类脚本语言开发中占据主流地位,CodeFuse智能研发助手就专门为VS Code研发了插件,只要安装插件就可以使用CodeFuse提供的各种功能,下面我们看看如何在VS Code中使用CodeFuse插件呢?CodeFuse 目前支持在 10 款 IDE 中安装,包括、Visual Studio Code(下文简称为 VS Code),以及。

CodeFuse的博客 2108

干货!MFTCoder论文多任务微调技术详解

来自:CodeFuse代码大模型(Code LLMs)已经成为一个专门的研究领域,通过使用代码相关数据对预训练模型进行微调来提升模型的编码能力。以往的微调方法通常针对特定的下游任务或场景进行定制,意味着每个任务需要单独进行微调,需要大量的训练资源,并且由于多个模型并存而难于维护和部署。此外,这些方法未能利用不同代码任务之间的内在联系。为了克服这些限制,我们提出了一种多任务微调框架——MFTCode...

zenRRan的博客 991

【追平 GPT-4o】开源写代码大模型 Qwen2.5-Coder 全系列来咯!强大、多样、实用

今天,我们很高兴开源“强大”、“多样”、“实用”的Qwen2.5-Coder全系列模型,致力于持续推动Open CodeLLMs的发展。Qwen2.5-Coder-32B-Instruct成为目前SOTA的开源代码模型,代码能力追平GPT-4o,展现出强大且全面的代码能力,同时具备良好的通用和数学能力。上个月我们开源了1.5B、7B两个尺寸,本次开源又带来0.5B、3B、14B、32B四个尺寸,截至目前,Qwen2.5-Coder已经覆盖了主流的六个模型尺寸,以满足不同开发者的需要。

AI天才研究院 2813

开源模型应用落地-CodeQwen模型小试-SQL专家测试(二)

使用CodeQwen1.5-7B-Chat模型,帮助开发人员获得高效、准确和个性化的代码支持

以微薄之力,予他人些许温暖. 7304

解读小红书11月AIGC新规:AI笔记需标注,三项优化降低种草内容限流

很多博主都会产生疑问,创作者在用 AI 写文案、制作配图去发布种草笔记的时候,不清楚要不要标注 AI 相关信息。本文参考小红书薯管家发布的治理公告,整理平台规则还有创作者能够用来自查的方法。本文只是从创作者角度整理出来的资料,全部实操要求需要依照小红书官方规则与薯管家后续发布的公告来执行。

2601_95507995的博客 226

02-AIGC工作流解析

加载文件:unet…z_image_turbo-Q4_K_M.gguf作用:加载量化为gguf格式的扩展到模型主干;gguf是量化格式,能在显存较小的显卡上跑大模型,代价画质略有损失。

242
上一篇: CodeFuse发布34B-4bit单卡4090可部署模型
下一篇: TensorRT-LLM在CodeFuse-CodeLlama-34B上的int4量化实践
CodeFuse
博客等级 码龄3年 630粉丝 74原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址