추신 : 코드 완료 및 문서 생성과 관련된 미세 조정은 https://github.com/unit-mesh/unit-eval을 참조하십시오.
성명서 :이 프로젝트에서 제공하는 데이터 세트 및 LORA 바이너리는 모두 OpenAI에 의해 만들어 지거나 온라인으로 게시됩니다. 우리는 모델 교육과 관련된 자습서 만 제공하며 사용자의 실제 교육 내용으로 인한 모든 결과는 사용자 자신의 책임입니다.
엔지니어의 경우 ChatGPT와 같은 대규모 언어 모델의 영향을 명확하게 볼 수 있으므로 AI의 R & D 효율성 개선에 대한 연구를 수행했습니다.
이 프로젝트는 일부 비디오 소개, 훈련 된 모델, 교육 코드, 교육 데이터 및 교육 과정에서의 일부 레코드를 포함하여 우리의 연구 결과입니다.
LORA 훈련에 대한 릴리스를 참조하십시오.
훈련 노트 :
라마 시리즈 온라인 비디오 :
ChatGLM 시리즈 온라인 비디오 :
목차 :
관련 데이터 변환은 https://github.com/unit-mesh/minions-data-prepare에서 사용할 수 있습니다
추신 : 더 나은 코드 생성이 필요한 경우 https://huggingface.co/salesforce/codegen-16b-mono를 사용하는 것이 좋습니다.
우리는 OpenBayes에서 제공하는 클라우드 GPU를 사용하고 있습니다 : https://openbayes.com/console/signup?r=phodal_uvxu
OpenBayes 모델을 사용할 수 있습니다.
로드맵 :
감사합니다 : OpenAi 키를위한 AIOS 클럽, 클라우드 GPU에 대한 OpenBayes에게 감사드립니다.
AI의 지각 효율성 개선은 R & D 효율의 표준화와 각 단계를 가능한 한 신중하게 분할하는 데 달려 있습니다.
교육 결과를보다 정확하게 만들기 위해 소프트웨어 개발 단계를 자세히 분할하여 각 단계가 정확한 결과를 얻을 수 있도록 정확한 결과를 주도합니다. 다음은 초기 분할에서 우리가 가지고있는 세부 과정의 작은 부분의 예입니다.
AI가 가장 큰 중계기 효과를 생성하기 위해 각 세련된 단계에서 데이터를 공급하여 가능한 한 작은 각 단계로 분할해야합니다.
토 도스
우리는 매우 간단한 지침을 사용하여 도구에 쉽게 통합 할 수 있도록 가능한 한 많은 것을 제공합니다. 다음과 같이 :
해당 기능 소개 :
예를 들어, 데이터의 양이 증가함에 따라 테스트 결과로 판단되면 20,000 개의 코드 사용 사례가 10,000 개의 코드 사용 사례보다 "스마트"됩니다.
기본 아이디어 :
아래 그림과 같이 :

Design a User Story Mapping for ${domain} application based on your understanding. Here are the requirements:
1 . Your user story map should include only user tasks to demonstrate how users will interact with the application.
2 . Our user story map should be based on your understanding of the ${domain} application and its users, and should be
designed to address their needs and pain points.
3 . You may use any tools or formats you choose to create your user story map, but it should be easily shareable and
understandable by stakeholders.
4 . Your expression should be more concise and clear.
5 . Your return should be like as follows:
###
User Tasks:
1 . ...
###샘플 출력 :
User Tasks:
1. Browse and search for animations and comics
2. View details of animations and comics
3. Create an account
4. Log in to the account
5. Add animations and comics to favorites
6. Download animations and comics
7. Share animations and comics with friends
8. Rate and review animations and comics
9. Create and upload animations and comics
10. Participate in online forums and discussions
为下面的需求编写用户故事:${domain} 应用的 ${story_name} 功能。 要求如下:
1 . 必须要考虑尽可能考虑各种异常场景,添加更多的 AC。
2 . 你的返回模板如下所示:
###
用户故事:可以选择宝贝出行服务
作为 莉莉妈
我想 在滴滴打车的手机客户端里选择宝贝出行服务
以便于 我能够带宝宝打车出行的时候打到有儿童座椅的车
AC 1: 莉莉妈可以选择宝贝出行服务
假设 xxx
当 xxx
于是 xxx
###샘플 출력 :
用户故事:可以创建和上传动画和漫画
作为一个 Animation and Comics 应用的用户
我想要创建和上传动画和漫画
以便于我可以分享我的作品给其他用户
AC 1: 用户可以创建和上传动画和漫画
假设 用户已经登录到 Animation and Comics 应用
当 用户点击创建和上传动画和漫画按钮
于是 用户可以创建和上传动画和漫画
기본 아이디어 :

src/main 에서 Java 파일을 가로 지르고 있습니다. PostService(PostRepository, UserRepository, ImageService)
- fields: postRepository:PostRepository, userRepository:UserRepository, userPosts:Set<Post>, imageService:ImageService
- methods: findAll(): List<Post>, addNewPost(Post): Post, saveImageToPost(String, MultipartFile, Post): int
예상 JSON 형식 :
예:
{"instruction":"Implement the method action","input":"com.thoughtworks.go.config.rules.AbstractDirective(DirectiveType, DirectiveType, String, String, String)n- fields: action:String, type:String, resource:String, configErrors:ConfigErrors, directiveType:DirectiveTypen- methods: validate(ValidationContext): void, isInvalid(String, List<String>): boolean, matchesAction(String): boolean, matchesType(Class<? extends Validatable>): boolean, matchesResource(String): boolean, errors(): ConfigErrors, addError(String, String): void, equals(Object): boolean, action(): String, type(): String, resource(): String, hashCode(): int, hasErrors(): boolean, getDirectiveType(): DirectiveType","output":"public abstract class AbstractDirective implements Directive {nn @ConfigAttribute(value = "action", optional = false)n protected String action;nn @ConfigAttribute(value = "type", optional = false)n protected String type;nn @ConfigValuen private String resource;nn private final ConfigErrors configErrors = new ConfigErrors();nn private DirectiveType directiveType;nn public AbstractDirective(DirectiveType allow) {n this.directiveType = allow;n }nn public AbstractDirective(DirectiveType allow, String action, String type, String resource) {n this.directiveType = allow;n this.action = action;n this.type = type;n this.resource = resource;n }nn @Overriden public String action() {n return this.action;n }n}n"}
형식 사양 :
包名.类名(类的构造类型)
- fields:成员变量集合(变量名:类型)
- methods:方法抽象集合(方法名(参数类型): 输出类型)
결과:
com.thoughtworks.go.config.rules.AbstractDirective(DirectiveType, DirectiveType, String, String, String)
- fields: action:String, type:String, resource:String, configErrors:ConfigErrors, directiveType:DirectiveType
- methods: validate(ValidationContext): void, isInvalid(String, List<String>): boolean, matchesAction(String): boolean, matchesType(Class<? extends Validatable>): boolean, matchesResource(String): boolean, errors(): ConfigErrors, addError(String, String): void, equals(Object): boolean, action(): String, type(): String, resource(): String, hashCode(): int, hasErrors(): boolean, getDirectiveType(): DirectiveType
val javaProcessor = JavaProcessor (file.readText())
val shotClass = javaProcessor.toShortClass() ? : return @forEach
javaProcessor
.removePackage()
.removeAllImport()
.removeLicenseInfoBeforeImport()
javaProcessor.splitMethods().forEach { (key, value) ->
CodegenPrompt (
instruction = " Implement the method $key " ,
input = shotClass.toString(),
output = value
). let { prompt ->
val output = Json .encodeToString(prompt)
File ( " $targetPath${key} .json " ).writeText(output)
}
}기본 아이디어

문법 분석 아이디어 :
src/main 하에서 Java 파일 맵을 만듭니다. 해당 테스트 파일이 동시에 존재하면 데이터 세트로 가져옵니다. org.unitmesh.processor.TestClass(String, Int)
- fields: field1:String, field2:Int
- methods: method1(String, Int): String, method2(): Int
class TestProcessorTest {
@ Test
void test1 () {
}
@ Test
void test2 () {
}
}마지막으로 생성 된 데이터는 다음과 같습니다.
{ "classInfo": "com.thoughteworks.go.security.aesencrypter (aescipherprovider) n- 필드 : 인코더 : base64.encoder, decoder : base64.decoder, cipherprovider : aescipherprovider, ivprovider : ivprovider n- 방법 : Createiv-Provider, () : CandeCrypt (String) : Boolean, Encrypt (String) : String, Decrypt (stryt) : String, CreateSecretkeyspec () : "testmethod", "testmethod": "public class aesencrypttertest { n private aesencryptter aesencryptter; n n n n n n n n n n n n n n n n n n n n n n n n n n) cryptoexception { n Strypt = aesencryptter.encrypt ( "p@ssw0rd"); n AssertThat (encrypt) .startswith ( "aes"); n AssertThat (accrypt.split ( ":")).
자세한 코드는 다음을 참조하십시오 : test-to-code.py
마지막 생성 된 Propt 예제는 다음과 같습니다.
You are a programmer and implementation a method with TDD. Here are the requirements:
1 . According follows class information and tests code to write a method.
2 . Try you best to thinking corner case.
3 . You only return the code, no explain.
class information:
###
io.github.robwin.swagger.test.AbstractContractValidator()
- methods: findExpectedPaths(Swagger, SwaggerAssertionConfig): Map<String,Path>, getPathsIncludingBasePath(Swagger):
Map<String,Path>, getPathsWithPrefix(Swagger, String): Map<String,Path>, isBlankOrSlash(String): boolean
###
test code:
###
/ **
* Tests AbstractContractValidator.
* /
@ RunWith (Enclosed.class)
public class AbstractContractValidatorTest {
/ **
* Tests getPathsIncludingBasePath().
* /
public static class GetPathsIncludingBasePath {
@ Test
public void shouldReturnPathsPrefixedIfBasePathSet() {
// given
Swagger swagger = buildSwaggerFrom("/swagger.json");
// when
Map<String, Path> paths = new DummyValidator().getPathsIncludingBasePath(swagger);
// then
paths.entrySet().forEach(e -> assertThat(e.getKey(), startsWith(swagger.getBasePath())));
}
}
/ **
* Tests findExpectedPaths().
* /
public static class FindExpectedPaths {
}
private static class DummyValidator extends AbstractContractValidator {
}
}
###
다음을 포함하여 기존 데이터 세트를 사용하십시오.
그러나이 두 코드 세트는 고품질이 아니지만 기본적으로 사용할 수 있습니다.
형식은 다음과 같습니다.
instruction:
我想查找特定月份(monthly_id)下在某个日期(date)之前的所有费用(expense),以方便了解特定月份内的开销情况。
input:
data class ExpenseEntity(....)
output:
@Query("SELECT * FROM expense WHERE monthly_id = :recurringExpenseId AND date < :beforeDate")
suspend fun getAllExpensesForRecurringExpenseBeforeDate(recurringExpenseId: Long, beforeDate: LocalDate): List<ExpenseEntity>
evaluate("text to kotlin repository with class", "我想查询指定年龄的用户(User)的博客数量。n ###data class User(var age: Int,
val blogId: Int) data class Post(val title: String)###", 0.1, 0.75, 40, 4, 512)
@Query("SELECT COUNT(*) FROM User WHERE age = :age")
abstract fun getBlogCount(age: Int): Long
기본 아이디어 :
instruction 형태로 두 부분으로 나누면 input null output .예:
instruction: 介绍一下财通财通宝的基金管理人、基金托管人在履行各自职责的过程中,违反《基金法》?
(一)基金管理人、基金托管人在履行各自职责的过程中,违反《基金法》等法律法规的规定或者基金合同约定, 给基金财产或者基金份额持有人造成损害的,
应当分别对各自的行为依法承担赔偿责任;因共同行为给基金财产或者基金份额持有人造成损害的,应当承担连带赔偿责任,对 损失的赔偿,仅限于直接损失。
但是发生下列情况,当事人可以免责: 1.基金管理人及基金托管人按照中国证监会的规定或当时有效的法律法规的作为或不作为而造成的损失等;
2.基金管理人由于按照基金合同规定的投资原则而行使或不行使其投资权而造成的损失等; 3.不可抗力。
기차:
훈련 시간 :
관련 배경 :
우리의 목표는 모델을 조정하고 일반적인 모델을 생성하는 것이 아니라 특정 목적으로 LORA를 훈련시키는 것입니다. 따라서 Stanford Alpaca의 데이터에 가입하지 않았으므로 필요한 시간이 짧습니다. 예를 들어, 8000+ 테스트 코드는 1 시간 밖에 걸리지 않으며 3400 개 이상의 사용자 스토리는 25 분 밖에 걸리지 않습니다.
교육 결과 (LORA)는 https://github.com/unit-mesh/unit-minions/releases/tag/v0.0.1에서 제공됩니다
print(evaluate("write test", """
public Set<String> listFilesUsingJavaIO(String dir) {
return Stream.of(new File(dir).listFiles())
.filter(file -> !file.isDirectory())
.map(File::getName)
.collect(Collectors.toSet());
}
""", 0.1, 0.75, 40, 4, 512))
## Output:
public class ListFilesUsingJavaIOTest {
@Test
public void shouldListFilesUsingJavaIO() {
Set<String> files = ListFilesUsingJavaIO.listFilesUsingJavaIO(new File("dir"));
assertThat(files, containsInAnyOrder("file1", "file2", "file3"));
}
}
교육 결과 (LORA)는 https://github.com/unit-mesh/unit-minions/releases/tag/v0.0.2에서 제공됩니다
알아채다:
--val_set_size 500--val_set_size 500--val_set_size 500샘플 출력 :
print(evaluate("create Agile user story for following topic: ", "购买电影票", 0.1, 0.75, 40, 4, 512))
用户故事:可以购买电影票
作为一个电影票购买者
我想在购买电影票应用中购买电影票
以便于我可以购买电影票
AC 1: 电影票购买者可以在购买电影票应用中购买电影票
假设 电影票购买者已经登录购买电影票应用
当 电影票购买者点击“购买电影票”按钮
于是 电影票购买者可以在购买电影票应用中购买电影票
AC 2: 电影票购买者可以在购买电影票应用中查看购买记录
假设 电影票购买者已经登录购买电影票应用
当 电影票购买者点击“查看购买记录”按钮
于是 电影票购买者可以在购买电影票应用中查看购买记录
AC 3: 电影票购买者可以在购买电影票应用中查看购买记录
假设 电影票购买者已经登录购买电影票应用
当 电影票购买者点击“查看购买记录”按��
교육 결과 (LORA)는 https://github.com/unit-mesh/unit-minions/releases/tag/v0.0.3에서 제공됩니다
샘플 출력 :
print(evaluate("Implement the method rmFiles", "FileUtils:", 0.1, 0.75, 40, 4, 512))
public class FileUtils {
private FileUtils() {
}
public static void rmFiles(String path) {
File dir = new File(path);
File[] files = dir.listFiles();
if (files != null) {
for (File file : files) {
if (file.isFile()) {
file.delete();
} else if (file.isDirectory()) {
FileUtils.rmFiles(file.getAbsolutePath());
}
}
}
}
}
변환 스크립트 : Code/Text-to-Sql.py
직접 : DataSets/SQL/SQL-Train.jsonl
샘플 출력 :
evaluate("text to sql", "谁是最美丽的人", 0.1, 0.75, 40, 4, 512)
evaluate("text to sql", "小明今年几岁", 0.1, 0.75, 40, 4, 512)
evaluate("text to sql", "What hand guard system is used with a gas piston commando?", 0.1, 0.75, 40, 4, 512)
기차:
Example 1:
evaluate("Instruction: 创建用户故事nInput: 电影网站: 查看订单详情 nAnswer:")
Instruction: 创建用户故事
Input: 电影网站: 查看订单详情
Answer:
用户故事:可以查看订单详情
作为一个电影网站的用户
我想查看订单详情
以便于我可以了解订单的详细信息,如订单号、订单状态、订单内容等。
AC 1: 用户可以查看订单详情
假设 用户已经登录
当 用户点击查看订单详情按钮
于是 用户可以查看订单详情,包括订单号、订单状态、订单内容等。
AC 2: 用户可以查看订单详情
假设 用户没有登录
当 用户点击查看订单详情按钮
于是 用户被要求先登录,然后才能查看订单详情,包括订单号、订单状态、订单内容等。
Example 2:
evaluate("Instruction: 创建用户故事nInput: 团购网站:用户注册nAnswer:")
Instruction: 创建用户故事
Input: 团购网站:用户注册
Answer:
团购网站的用户注册故事:
作为一个团购网站的用户
我想注册一个团购网站的用户账号
以便于我可以使用团购服务,如购买商品、服务等。
AC 1: 团购网站的用户注册账号
假设 用户输入了注册信息
当 用户提交注册信息
于是 用户可以成功注册一个团购网站的用户账号
AC 2: 团购网站的用户注册账号
假设 用户输入了错误的注册信息
当 用户提交注册信息
于是 用户可以被提示输入正确的注册信息,并重新提交注册信息