huskyhong commited on
Commit
67b8ead
·
verified ·
1 Parent(s): 5b36553

Upload 3 files

Browse files
Files changed (3) hide show
  1. LICENSE +201 -0
  2. README.md +148 -3
  3. README_zh.md +138 -0
LICENSE ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
README.md CHANGED
@@ -1,3 +1,148 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [切换到中文版本](README_zh.md)
2
+
3
+ [Switch to English Version](README.md)
4
+
5
+ # Noname AI
6
+
7
+ Projects related to Noname AI/Noname AI, involving AI programs aimed at generating Noname skill codes by inputting skill effects.
8
+
9
+ [modelscope Online Experience](https://www.modelscope.cn/studios/huskyhong/nonameai)
10
+
11
+ Due to limited computing power, the online experience version is only a lightweight CPU version with limited precision. If needed, please choose the GPU version or full version for inference.
12
+ Fine-tuned from QWen.
13
+
14
+ ## Configuration Requirements
15
+
16
+ To better meet usage requirements, please try to meet the following requirements:
17
+
18
+ - Computer (required)
19
+ - Hard disk storage space of 20G or more (required)
20
+ - If using the full non-quantized version/GPU version lazy one-click package, for computers with NVIDIA graphics cards, GPU inference is used, requiring half of the graphics memory + computer physical memory (physical memory does not include virtual memory) >= 16G
21
+ - If using the full non-quantized version/CPU version lazy one-click package, CPU inference is used, requiring memory (including virtual memory) to be as close as possible to >= 32G for computers without graphics cards
22
+ - If using the lightweight version/GPU version lightweight lazy one-click package, for computers with NVIDIA graphics cards, GPU inference is used, requiring half of the graphics memory + computer physical memory (physical memory does not include virtual memory) >= 4G
23
+ - If using the lightweight version/CPU version lightweight lazy one-click package, CPU inference is used, requiring memory (including virtual memory) to be as close as possible to >= 12G for computers without graphics cards
24
+
25
+ ## Usage
26
+
27
+ ### Full Model Method
28
+
29
+ 1. Install Python and the corresponding Python compiler.
30
+ - Note: Python compatible versions are 3.8, 3.9, 3.10, 3.11. Please do not install versions that are too high or too low.
31
+ 2. Enter the following command in the terminal to install the required environment:
32
+
33
+ ```bash
34
+ pip install -r requirements.txt
35
+ ```
36
+
37
+ 3. Run the program using the following Python code. The model will be automatically downloaded, and the code defaults to version 2.0 full version.
38
+ ```python
39
+ from transformers import AutoModelForCausalLM, AutoTokenizer
40
+ from transformers.generation import GenerationConfig
41
+ tokenizer = AutoTokenizer.from_pretrained("huskyhong/noname-ai-v2_5", trust_remote_code=True)
42
+ model = AutoModelForCausalLM.from_pretrained("huskyhong/noname-ai-v2_5", device_map="auto", trust_remote_code=True).eval() # Load the model using GPU
43
+ # model = AutoModelForCausalLM.from_pretrained("huskyhong/noname-ai-v2_5", device_map="cpu", trust_remote_code=True).eval() # Load the model using CPU
44
+ 5model.generation_config = GenerationConfig.from_pretrained("huskyhong/noname-ai-v2_5", trust_remote_code=True) # You can specify different generation lengths, top_p, 和 other related hyperparameters
45
+ # For the first generation model, replace "huskyhong/noname-ai-v2_5" with "huskyhong/noname-ai-v1". For lightweight version v2.5 model, replace "huskyhong/noname-ai-v2_5" with "huskyhong/noname-ai-v2_5-light"
46
+
47
+ prompt = "请帮我编写一个技能,技能效果如下:" + input("请输入技能效果:")
48
+ response, history = model.chat(tokenizer, prompt, history = [])
49
+ print(response)
50
+
51
+ prompt = "请帮我编写一张卡牌,卡牌效果如下::" + input("请输入卡牌效果:")
52
+ response, history = model.chat(tokenizer, prompt, history = [])
53
+ print(response)
54
+ ```
55
+ Alternatively, you can use Hugging Face's pipeline for inference.
56
+ ```python
57
+ from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM, GenerationConfig
58
+ generator = pipeline(
59
+ "text-generation",
60
+ model="huskyhong/noname-ai-v2_5",
61
+ tokenizer="huskyhong/noname-ai-v2_5",
62
+ device=0, # Choose GPU device. If you want to use CPU, you can set device=-1
63
+ trust_remote_code=True
64
+ )
65
+
66
+ prompt = "请帮我编写一个技能,技能效果如下:" + input("请输入技能效果:")
67
+ response = generator(prompt, max_length=50, top_p=0.95) # You can adjust parameters such as generation length, top_p as needed
68
+ print(response[0]['generated_text'])
69
+
70
+ prompt = "请帮我编写一张卡牌,卡牌效果如下:" + input("请输入卡牌效果:")
71
+ response = generator(prompt, max_length=50, top_p=0.95) # You can adjust parameters such as generation length, top_p as needed
72
+ print(response[0]['generated_text'])
73
+ ```
74
+
75
+ 4. If automatic downloading fails, you can manually download the model files and modify "huskyhong/noname-ai-v2" to the corresponding location in the code.
76
+ Download links for the second-generation model:
77
+ - [v2.5 Hugging Face address (full version)](https://huggingface.co/huskyhong/noname-ai-v2_5)
78
+ - [v2.5 Hugging Face address (lightweight version)](https://huggingface.co/huskyhong/noname-ai-v2_5-light)
79
+ - [Baidu Netdisk address](https://pan.baidu.com/s/1m9RfGqnuQbRYROE_UzuG-Q?pwd=6666) Baidu Netdisk extraction code: 6666
80
+ Download links for the first-generation model:
81
+ - [Hugging Face address](https://huggingface.co/huskyhong/noname-ai-v1)
82
+ - [Baidu Netdisk address](https://pan.baidu.com/s/1Ox471XuHF_gJbcPPnSZe7g?pwd=6666) Baidu Netdisk extraction code: 6666
83
+ Remember to choose whether to load the model using GPU or CPU, and replace `your_model_name` with your actual model path.
84
+
85
+ ## Lazy One-Click Package
86
+
87
+ - One-click installation, no worries.
88
+ - Please choose the appropriate lazy one-click package according to your own configuration.
89
+ - [Lazy One-Click Package Baidu Netdisk Download Address (Updated to v2.5)](https://pan.baidu.com/s/1zIcRZtQv5oIdu7_abie9Vw?pwd=6666) Baidu Netdisk extraction code: 6666
90
+ - [Lazy One-Click Package 123 Netdisk Download Address (Updated to v2.5)](https://www.123pan.com/s/lOcnjv-pnOG3.html) 123 Netdisk extraction code: 6666
91
+ - Please pay attention to the version time of the lazy one-click package to ensure that the version is the latest!
92
+ - Lazy package related videos
93
+ - [Comparison of Effects of Lazy Package v2.5](https://www.bilibili.com/video/BV1KKY4e8EaC/)
94
+
95
+ ## Web Version/Server Deployment
96
+ - Install Python
97
+ - Install dependencies
98
+ ```bash
99
+ pip install -r requirements.txt
100
+ ```
101
+ - Install Streamlit
102
+ ```bash
103
+ pip install streamlit
104
+ ```
105
+ - Allow port 8501 on the server (can also be changed to others, corresponding to webdemo.py file)
106
+ - Run webdemo
107
+ ```bash
108
+ streamlit run webdemo.py
109
+ ```
110
+ ## Training
111
+ Training requires installing new dependencies:
112
+ ```python
113
+ pip install peft deepspeed
114
+ ```
115
+ Clone the project和download the v2.3 version of the model files, taking the lightweight version as an example:
116
+ ```bash
117
+ git lfs install
118
+ git clone https://github.com/204313508/noname_llm.git
119
+ git clone https://huggingface.co/huskyhong/noname-ai-v2_3-light
120
+ cd noname_llm/finetune
121
+ ```
122
+ Modify the parameters required for training in the finetune script, such as model and dataset locations, then enter the following command to start training:
123
+ ```bash
124
+ bash finetune.sh
125
+ ```
126
+ Please refer to the [Fine-tuning Guide](./finetune/README.md) for detailed steps.
127
+
128
+ ## Web Version/Server Example
129
+ ![webdemo1](./webdemo1.png)
130
+ ![webdemo2](./webdemo2.png)
131
+
132
+ ## Notes
133
+
134
+ - AI generation is subject to uncontrollable factors, and the generated code does not guarantee 100% effectiveness. Bugs, redundant code, or additional special characters may still occur and require manual modification.
135
+ - (Important) Follow AI specifications. This AI model is for learning and communication purposes only. Please do not use it for illegal or commercial purposes. The purpose of releasing this model is to encourage better learning and communication, and all related information involved in the model is public. I bear no responsibility for malicious use of this AI model.
136
+
137
+ ## Other Content
138
+
139
+ If you have any related questions, please raise them in the official GitHub issue.
140
+
141
+ ## Demo Images
142
+ These demo images are based on version 2.3 release.
143
+ ![demo](./demo.png)
144
+
145
+
146
+ ## Sponsorship
147
+ - Shamelessly begging for sponsorship
148
+ ![sponsor](./sponsor.jpg)
README_zh.md ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [切换到中文版本](README_zh.md)
2
+
3
+ [Switch to English Version](README.md)
4
+ # 无名杀AI
5
+
6
+ 无名杀ai/无名杀AI相关项目,该项目涉及AI程序,旨在通过输入技能效果,生成无名杀技能代码。
7
+ [modelscope(魔搭社区)在线体验](https://www.modelscope.cn/studios/huskyhong/nonameai)
8
+ 因为算力有限,在线体验版本仅为轻量cpu版,精度有限,如有需求请选择gpu版、完整版进行推理
9
+ finetuned from QWen
10
+ ## 配置要求
11
+
12
+ 为了更好地满足使用需求,请尽可能满足以下要求:
13
+
14
+ - 电脑(必须)
15
+ - 硬盘存储空间20G以上(必须)
16
+ - 若使用完整非量化版本/gpu版懒人一键包,对于具有 NVIDIA 显卡的电脑,采用gpu推理,要求显存 + 电脑物理内存(物理内存不包含虚拟内存)的一半 >= 16G
17
+ - 若使用完整非量化版本/cpu版懒人一键包,采用cpu方式推理,对于无显卡的电脑,要求内存(可包含虚拟内存)尽可能满足 >= 32G
18
+ - 若使用轻量版/gpu版轻量版懒人一键包,对于具有 NVIDIA 显卡的电脑,采用gpu推理,要求显存 + 电脑物理内存(物理内存不包含虚拟内存)的一半 >= 4G
19
+ - 若使用轻量版/cpu版轻量版懒人一键包,采用cpu方式推理,对于无显卡的电脑,要求内存(可包含虚拟内存)尽可能满足 >= 12G
20
+
21
+ ## 使用方法
22
+ ### 完整模型法
23
+ 1. 安装 Python 以及相应的 Python 编译器
24
+ - 注意:python适配版本为3.8,3.9,3.10,3.11,请勿安装过高或过低版本
25
+ 2. 在终端(命令行)中输入以下命令安装依赖环境:
26
+
27
+ ```bash
28
+ pip install -r requirements.txt
29
+ ```
30
+ 3. 采用以下python代码运行程序,模型将会自动下载,代码默认为v2.0完整版
31
+ ```python
32
+ from transformers import AutoModelForCausalLM, AutoTokenizer
33
+ from transformers.generation import GenerationConfig
34
+ tokenizer = AutoTokenizer.from_pretrained("huskyhong/noname-ai-v2_5", trust_remote_code=True)
35
+ model = AutoModelForCausalLM.from_pretrained("huskyhong/noname-ai-v2_5", device_map="auto", trust_remote_code=True).eval() # 采用gpu加载模型
36
+ # model = AutoModelForCausalLM.from_pretrained("huskyhong/noname-ai-v2_5", device_map="cpu", trust_remote_code=True).eval() # 采用cpu加载模型
37
+ model.generation_config = GenerationConfig.from_pretrained("huskyhong/noname-ai-v2_5", trust_remote_code=True) # 可指定不同的生成长度、top_p等相关超参
38
+ # 第一代模型请将huskyhong/noname-ai-v2_5改为huskyhong/noname-ai-v1,轻量版v2.5模型请将huskyhong/noname-ai-v2_5改为huskyhong/noname-ai-v2_5-light
39
+
40
+ prompt = "请帮我编写一个技能,技能效果如下:" + input("请输入技能效果:")
41
+ response, history = model.chat(tokenizer, prompt, history = [])
42
+ print(response)
43
+
44
+ prompt = "请帮我编写一张卡牌,卡牌效果如下::" + input("请输入卡牌效果:")
45
+ response, history = model.chat(tokenizer, prompt, history = [])
46
+ print(response)
47
+ ```
48
+ 也可以采用huggingface的pipeline进行推理
49
+ ```python
50
+ from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM, GenerationConfig
51
+ generator = pipeline(
52
+ "text-generation",
53
+ model="huskyhong/noname-ai-v2_5",
54
+ tokenizer="huskyhong/noname-ai-v2_5",
55
+ device=0, # 选择GPU设备,如果要使用CPU,可以设置device=-1
56
+ trust_remote_code=True
57
+ )
58
+
59
+ prompt = "请帮我编写一个技能,技能效果如下:" + input("请输入技能效果:")
60
+ response = generator(prompt, max_length=50, top_p=0.95) # 可根据需要调整生成长度、top_p等超参数)
61
+ print(response[0]['generated_text'])
62
+
63
+ prompt = "请帮我编写一张卡牌,卡牌效果如下:" + input("请输入卡牌效果:")
64
+ response = generator(prompt, max_length=50, top_p=0.95) # 可根据需要调整生成长度、top_p等超参数
65
+ print(response[0]['generated_text'])
66
+ ```
67
+
68
+ 4. 如果自动下载出错,可以手动下载模型文件,同时修改代码中的"huskyhong/noname-ai-v2"为相应位置
69
+ 第二代模型下载地址:
70
+ - [v2.5版本huggingface地址(完整版)](https://huggingface.co/huskyhong/noname-ai-v2_5)
71
+ - [v2.5版本huggingface地址(轻量版)](https://huggingface.co/huskyhong/noname-ai-v2_5-light)
72
+ - [百度网盘地址](https://pan.baidu.com/s/1m9RfGqnuQbRYROE_UzuG-Q?pwd=6666) 百度网盘提取码:6666
73
+ 第一代模型下载地址:
74
+ - [huggingface地址](https://huggingface.co/huskyhong/noname-ai-v1)
75
+ - [百度网盘地址](https://pan.baidu.com/s/1Ox471XuHF_gJbcPPnSZe7g?pwd=6666) 百度网盘提取码:6666
76
+ 记得选择采用gpu加载模型还是cpu加载模型,然后把 `your_model_name` 替换为你实际的模型路径。
77
+
78
+ ## 懒人一键包
79
+ - 一键安装,无需烦恼
80
+ - 请根据自身配置选择合适的懒人一键包
81
+ - [懒人一键包百度网盘下载地址(已更新v2.5)](https://pan.baidu.com/s/1zIcRZtQv5oIdu7_abie9Vw?pwd=6666) 百度网盘提取码:6666
82
+ - [懒人���键包123网盘下载地址(已更新v2.5)](https://www.123pan.com/s/lOcnjv-pnOG3.html) 123网盘提取码:6666
83
+ - 请注意懒人一键包版本时间,确保版本为最新版!
84
+ - 懒人包相关视频
85
+ - [懒人包v2.5版效果对比]([https://www.bilibili.com/video/BV1KKY4e8EaC]
86
+ ## 网页版/服务器部署
87
+ - 安装 Python
88
+ - 安装依赖环境
89
+ ```bash
90
+ pip install -r requirements.txt
91
+ ```
92
+ - 安装streamlit
93
+ ```bash
94
+ pip install streamlit
95
+ ```
96
+ - 服务器放行8501端口(也可自行改成其他,需要和webdemo.py文件中对应)
97
+ - 运行webdemo
98
+ ```bash
99
+ streamlit run webdemo.py
100
+ ```
101
+
102
+ ## 训练/微调
103
+ 训练/微调需要安装新的依赖项
104
+ ```python
105
+ pip install peft deepspeed
106
+ ```
107
+ 克隆该项目,并下载v2.3版本的模型文件,以轻量版为例:
108
+ ```bash
109
+ git lfs install
110
+ git clone https://github.com/204313508/noname_llm.git
111
+ git clone https://huggingface.co/huskyhong/noname-ai-v2_3-light
112
+ cd noname_llm/finetune
113
+ ```
114
+ 修改finetune.sh中训练所需参数,模型、数据集位置等信息,之后输入以下命令开始训练
115
+ ```bash
116
+ bash finetune.sh
117
+ ```
118
+ 详细步骤请参考[微调说明](./finetune/README.md)
119
+
120
+ ## 网页版/服务器示例
121
+ ![webdemo1](./webdemo1.png)
122
+ ![webdemo2](./webdemo2.png)
123
+ ## 注意事项
124
+
125
+ - AI生成受不可控因素影响,生成的代码不保证100%有效,仍可能出现bug、冗余代码或额外特殊符号等,需要人工修改。
126
+ - (重要)遵循AI规范,本AI模型仅用于学习交流使用,请勿用于不法用途以及商业用途。本人发布该模型初衷是希望大家更好地学习和交流,模型涉及的所有相关信息都是公开的。对于恶意使用本AI模型的,本人概不负责。
127
+
128
+ ## 其他内容
129
+
130
+ 如果有相关问题,请在GitHub官方的issue中提出。
131
+
132
+ ## 演示图片
133
+ 该演示图片基于v2.3发布
134
+ ![demo1](./demo.png)
135
+
136
+ ## 赞助
137
+ - 厚颜无耻的求一个赞助
138
+ ![sponsor](./sponsor.jpg)