codefuse-admin
commited on
Commit
•
8d6c76c
1
Parent(s):
ddd0793
Update README.md
Browse files
README.md
CHANGED
@@ -9,20 +9,20 @@
|
|
9 |
🤖 <a href="https://modelscope.cn/organization/codefuse-ai" target="_blank">ModelScope</a>
|
10 |
</p>
|
11 |
|
12 |
-
DevOps-Model
|
13 |
|
14 |
-
|
15 |
-
<br>
|
16 |
-
同时我们也在搭建 DevOps 领域专属的评测基准 [DevOpsEval](https://github.com/codefuse-ai/codefuse-devops-eval),用来更好评测 DevOps 领域模型的效果。
|
17 |
|
|
|
|
|
18 |
<br>
|
19 |
<br>
|
20 |
|
21 |
-
#
|
22 |
-
|
23 |
|
24 |
-
|
|
25 |
-
|
26 |
| CMMLU | Computer science | 204 |
|
27 |
| CMMLU | Computer security | 171 |
|
28 |
| CMMLU | Machine learning | 122 |
|
@@ -30,9 +30,10 @@ DevOps-Model-7B-Chat 是我们经过高质量 DevOps 语料训练基于 Qwen-7B
|
|
30 |
| CEval | Computer architecture | 21 |
|
31 |
| CEval | Computernetwork | 19 |
|
32 |
|
33 |
-
我们分别测试了 Zero-shot 和 Five-shot 的结果,我们的 DevOps-Model-7B-Chat 模型可以在测试的同规模的开源 Chat 模型中取得最高的成绩,后续我们也会进行更多的测试。
|
34 |
|
35 |
-
|
|
|
|
|
36 |
|--|--|--|--|
|
37 |
|**DevOps-Model-7B-Chat**|**7B**|**62.20**|**64.11**|
|
38 |
|Qwen-7B-Chat|7B|46.00|52.44|
|
@@ -42,20 +43,14 @@ DevOps-Model-7B-Chat 是我们经过高质量 DevOps 语料训练基于 Qwen-7B
|
|
42 |
|
43 |
<br>
|
44 |
|
45 |
-
#
|
46 |
-
|
47 |
-
|
48 |
-
## 要求
|
49 |
-
- python 3.8 及以上版本
|
50 |
-
- pytorch 2.0 及以上版本
|
51 |
-
- 建议使用CUDA 11.4及以上
|
52 |
-
|
53 |
|
54 |
## 依赖项安装
|
55 |
下载模型后,直接通过以下命令安装 requirements.txt 中的包就可以
|
56 |
```bash
|
57 |
cd path_to_download_model
|
58 |
-
pip
|
59 |
```
|
60 |
|
61 |
## 模型推理示例
|
@@ -64,42 +59,23 @@ pip isntall -r requirements.txt
|
|
64 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
65 |
from transformers.generation import GenerationConfig
|
66 |
|
67 |
-
tokenizer = AutoTokenizer.from_pretrained("path_to_DevOps-Model
|
|
|
68 |
|
69 |
-
model =
|
70 |
|
71 |
-
|
72 |
-
model.generation_config = GenerationConfig.from_pretrained("path_to_DevOps-Model-7B-Chat", trust_remote_code=True)
|
73 |
-
|
74 |
-
# 第一轮对话
|
75 |
-
resp, hist = model.chat(query='你是谁', tokenizer=tokenizer, history=None)
|
76 |
-
print(resp)
|
77 |
-
# 我是 DevOps-Model,一个由蚂蚁集团平台技术事业群风险智能团队和北京大学联合研发的人工智能机器人,可以与用户进行自然语言交互,并协助解答 DevOps 全生命周期中的各种问题。如果您有任何需要协助的问题或者想要进行闲聊,都可以和我交流哦。
|
78 |
-
|
79 |
-
# 第二轮对话
|
80 |
-
resp2, hist2 = model.chat(query='Java 中 HashMap 和 Hashtable 有什么区别', tokenizer=tokenizer, history=hist)
|
81 |
-
print(resp2)
|
82 |
-
# HashMap 和 Hashtable 都是 Java 中常用的哈希表实现,它们的主要区别在于:
|
83 |
-
# 1. Hashtable 是线程安全的,而 HashMap 不是线程安全的,因此在多线程环境下,Hashtable 的性能更稳定。
|
84 |
-
# 2. Hashtable 中的方法都是同步的,而 HashMap 的方法不是同步的,因此在多线程环境下,Hashtable 的性能更好。
|
85 |
-
# 3. Hashtable 中的 key 和 value 都必须实现 Serializable 接口,而 HashMap 中的 key 和 value 可以是任何对象,包括基本数据类型。
|
86 |
-
# 4. Hashtable 的初始容量是 11,而 HashMap 的初始容量是 16。
|
87 |
-
# 总之,如果需要在多线程环境下使用哈希表,并且需要保证线程安全,那么应该使用 Hashtable;如果不需要考虑线程安全,或者需要快速地进行哈希表操作,那么应该使用 HashMap。
|
88 |
-
|
89 |
-
# 第三轮对话
|
90 |
-
resp3, hist3 = model.chat(query='线程安全代表什么', tokenizer=tokenizer, history=hist2)
|
91 |
-
print(resp3)
|
92 |
-
# 线程安全是指在多线程环境下,程序能够正确地处理并发访问,并且不会出现数据竞争、死锁、饥饿等异常情况。线程安全的程序可以保证在不同的线程之间共享同一个数据结构时,数据的正确性和一致性。线程安全的实现通常需要使用同步机制,如锁、原子操作等,来保证对共享数据的访问是线程安全的。在 Java 中,可以通过 synchronized 关键字、Lock 接口等机制来实现线程安全。
|
93 |
```
|
94 |
|
95 |
|
96 |
|
97 |
-
#
|
98 |
-
|
99 |
-
|
|
|
100 |
|
101 |
|
102 |
-
#
|
103 |
-
|
104 |
- [LLaMA-Efficient-Tuning](https://github.com/hiyouga/LLaMA-Efficient-Tuning)
|
105 |
-
- [
|
|
|
9 |
🤖 <a href="https://modelscope.cn/organization/codefuse-ai" target="_blank">ModelScope</a>
|
10 |
</p>
|
11 |
|
12 |
+
DevOps-Model is a Chinese **DevOps large model**, mainly dedicated to exerting practical value in the field of DevOps. Currently, DevOps-Model can help engineers answer questions encountered in the all DevOps life cycle.
|
13 |
|
14 |
+
Based on the Qwen series of models, we output the **Base** model after additional training with high-quality Chinese DevOps corpus, and then output the **Chat** model after alignment with DevOps QA data. Our Base model and Chat model can achieve the best results among models of the same scale based on evaluation data related to the DevOps fields.
|
|
|
|
|
15 |
|
16 |
+
<br>
|
17 |
+
At the same time, we are also building an evaluation benchmark [DevOpsEval](https://github.com/codefuse-ai/codefuse-devops-eval) exclusive to the DevOps field to better evaluate the effect of the DevOps field model.
|
18 |
<br>
|
19 |
<br>
|
20 |
|
21 |
+
# Evaluation
|
22 |
+
We first selected a total of six exams related to DevOps in the two evaluation data sets of CMMLU and CEval. There are a total of 574 multiple-choice questions. The specific information is as follows:
|
23 |
|
24 |
+
| Evaluation dataset | Exam subjects | Number of questions |
|
25 |
+
|:-------:|:-------:|:-------:|
|
26 |
| CMMLU | Computer science | 204 |
|
27 |
| CMMLU | Computer security | 171 |
|
28 |
| CMMLU | Machine learning | 122 |
|
|
|
30 |
| CEval | Computer architecture | 21 |
|
31 |
| CEval | Computernetwork | 19 |
|
32 |
|
|
|
33 |
|
34 |
+
We tested the results of Zero-shot and Five-shot respectively. Our 7B and 14B series models can achieve the best results among the tested models. More tests will be released later.
|
35 |
+
|
36 |
+
|Model|Zero-shot Score|Five-shot Score|
|
37 |
|--|--|--|--|
|
38 |
|**DevOps-Model-7B-Chat**|**7B**|**62.20**|**64.11**|
|
39 |
|Qwen-7B-Chat|7B|46.00|52.44|
|
|
|
43 |
|
44 |
<br>
|
45 |
|
46 |
+
# Quickstart
|
47 |
+
We provide simple examples to illustrate how to quickly use Devops-Model-Chat models with 🤗 Transformers.
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
## 依赖项安装
|
50 |
下载模型后,直接通过以下命令安装 requirements.txt 中的包就可以
|
51 |
```bash
|
52 |
cd path_to_download_model
|
53 |
+
pip install -r requirements.txt
|
54 |
```
|
55 |
|
56 |
## 模型推理示例
|
|
|
59 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
60 |
from transformers.generation import GenerationConfig
|
61 |
|
62 |
+
tokenizer = AutoTokenizer.from_pretrained("path_to_DevOps-Model", trust_remote_code=True)
|
63 |
+
model = AutoModelForCausalLM.from_pretrained("path_to_DevOps-Model", device_map="auto", trust_remote_code=True, bf16=True).eval()
|
64 |
|
65 |
+
model.generation_config = GenerationConfig.from_pretrained("path_to_DevOps-Model", trust_remote_code=True)
|
66 |
|
67 |
+
resp, hist = model.chat(query='What is the difference between HashMap and Hashtable in Java', tokenizer=tokenizer, history=None)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
```
|
69 |
|
70 |
|
71 |
|
72 |
+
# Disclaimer
|
73 |
+
Due to the characteristics of language models, the content generated by the model may contain hallucinations or discriminatory remarks. Please use the content generated by the DevOps-Model family of models with caution.
|
74 |
+
If you want to use this model service publicly or commercially, please note that the service provider needs to bear the responsibility for the adverse effects or harmful remarks caused by it. The developer of this project does not assume any responsibility for any consequences caused by the use of this project (including but not limited to data, models, codes, etc.) ) resulting in harm or loss.
|
75 |
+
|
76 |
|
77 |
|
78 |
+
# Acknowledgments
|
79 |
+
This project refers to the following open source projects, and I would like to express my gratitude to the relevant projects and research and development personnel.
|
80 |
- [LLaMA-Efficient-Tuning](https://github.com/hiyouga/LLaMA-Efficient-Tuning)
|
81 |
+
- [QwenLM](https://github.com/QwenLM)
|