-
Notifications
You must be signed in to change notification settings - Fork 94
/
LLM_Party for Local Models.json
422 lines (422 loc) · 9.9 KB
/
LLM_Party for Local Models.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
{
"last_node_id": 38,
"last_link_id": 53,
"nodes": [
{
"id": 32,
"type": "LLM_local",
"pos": [
900,
290
],
"size": {
"0": 460,
"1": 700
},
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "CUSTOM",
"link": 49,
"label": "model"
},
{
"name": "tokenizer",
"type": "CUSTOM",
"link": 50,
"label": "tokenizer"
},
{
"name": "image",
"type": "IMAGE",
"link": null,
"label": "image"
},
{
"name": "extra_parameters",
"type": "DICT",
"link": null,
"label": "extra_parameters"
},
{
"name": "system_prompt_input",
"type": "STRING",
"link": null,
"widget": {
"name": "system_prompt_input"
},
"label": "system_prompt_input"
},
{
"name": "user_prompt_input",
"type": "STRING",
"link": null,
"widget": {
"name": "user_prompt_input"
},
"label": "user_prompt_input"
},
{
"name": "tools",
"type": "STRING",
"link": null,
"widget": {
"name": "tools"
},
"label": "tools"
},
{
"name": "file_content",
"type": "STRING",
"link": null,
"widget": {
"name": "file_content"
},
"label": "file_content"
}
],
"outputs": [
{
"name": "assistant_response",
"type": "STRING",
"links": [
47,
51
],
"shape": 3,
"label": "assistant_response",
"slot_index": 0
},
{
"name": "history",
"type": "STRING",
"links": null,
"shape": 3,
"label": "history"
},
{
"name": "tool",
"type": "STRING",
"links": null,
"shape": 3,
"label": "tool"
},
{
"name": "image",
"type": "IMAGE",
"links": null,
"shape": 3,
"label": "image"
}
],
"properties": {
"Node name for S&R": "LLM_local"
},
"widgets_values": [
"你是一个翻译专家",
"把以下内容翻译为中文:“large language model party”,只需要输出翻译内容,不需要回复其他内容。",
"Qwen",
0.7,
512,
"disable",
"disable",
"enable",
"",
"",
"",
"",
100,
"",
true
],
"shape": 1
},
{
"id": 38,
"type": "clear_model",
"pos": [
910,
1050
],
"size": {
"0": 450,
"1": 110
},
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "any",
"type": "*",
"link": 51,
"label": "any"
},
{
"name": "model",
"type": "CUSTOM",
"link": 52,
"label": "model",
"slot_index": 1
},
{
"name": "tokenizer",
"type": "CUSTOM",
"link": 53,
"label": "tokenizer",
"slot_index": 2
}
],
"outputs": [
{
"name": "any",
"type": "*",
"links": null,
"shape": 3,
"label": "any"
}
],
"properties": {
"Node name for S&R": "clear_model"
},
"shape": 1
},
{
"id": 22,
"type": "LLM_local_loader",
"pos": [
460,
300
],
"size": {
"0": 410,
"1": 220
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "model",
"type": "CUSTOM",
"links": [
49,
52
],
"shape": 3,
"label": "model",
"slot_index": 0
},
{
"name": "tokenizer",
"type": "CUSTOM",
"links": [
50,
53
],
"shape": 3,
"label": "tokenizer",
"slot_index": 1
}
],
"properties": {
"Node name for S&R": "LLM_local_loader"
},
"widgets_values": [
"Qwen/Qwen2-7B-Instruct",
"Qwen",
"/hy-tmp/AI_files/models/LLM_Models/qwen7b",
"/hy-tmp/AI_files/models/LLM_Models/qwen7b",
"auto",
"int4",
false
],
"color": "#2a363b",
"bgcolor": "#3f5159",
"shape": 1
},
{
"id": 34,
"type": "Note",
"pos": [
470,
580
],
"size": {
"0": 400,
"1": 580
},
"flags": {},
"order": 1,
"mode": 0,
"properties": {
"text": ""
},
"widgets_values": [
"##介绍:\n该工作流是通过加载本地的大语言模型,模块化实现工具调用功能。\n\n##参数详解:\n·model_name:填写需要加载的模型名称(也可以不填写,如果模型文件夹路径没有填写,会根据模型名称从hugging face上下载并加载模型,目前只支持safetensors格式或者bin格式加载)\n- 填写示例:Qwen/Qwen2-7B-Instruct\n- 注:必须与hugging face上的模型名称一致且包含仓库名。\n·model_type:目前已经兼容:GLM、llama、Qwen\n·model_path:上传本地大语言模型的模型文件夹路径,优先本地路径加载模型\n - 填写示例:/hy-tmp/AI_files/models/LLM_Models/qwen7b;\n - 注:该路径是Linux系统文件路径,Windows需要将“/”改为“\\”。例如:D:\\AI\\mychat\\model\\qwen7b\n·tokenizer_path:填写路径同上。\n·device:一般默认状态为[auto],自动选择你的cuda/mps/cpu设备,可根据实际情况进行调整。\n·dtype:量化方式,可以让模型以更小的方式加载。在MacOS系统下,int8/int4量化不可用。\n\n·**is_locked**:\n- 默认是[true]状态,在该状态下,模型不会自动切换,也就意味着不需要重复加载模型,但是模型运行的显存不会被清空。(推荐!当你不需要频繁切换模型时,将[is_locked]选择为[true],然后将工作流中的卸载模型节点删除)\n- 如果是[false]状态,也即关闭状态,它就会一直加新的模型。所以在这种情形下,需要在连接【Clear Model/清空模型】节点,来清理缓存。这样做的好处是,可以在任意位置将你的模型卸载,保证后续的模型可以使用显存。\n\n##注:\n·【本地LLM加载器】和【本地大语言模型】节点下的[model_type]需要根据本地的大语言模型调整至相同的类型。\n\n-------------------------------------------------------------------------\n本地LLM资源链接:\n·百度网盘:\nhttps://pan.baidu.com/s/1T4aEB4HumdJ7iVbvsv1vzA?pwd=qyhu 提取码: qyhu\n\n-------------------------------------------------------------------------\n##写在最后:\n·LLM_Party正在用心经营一片AI时代的后花园,我们希望能够在AI时代下成为众多参与者的一员,我们从开源社区中走来,也希望回到社区中去。\n·欢迎大家来到我们用心经营的后花园:\n - QQ交流群:931057213\n - 微信交流群:Choo-Yong(添加小助理微信,统一通过后会添加至交流群)"
],
"color": "#432",
"bgcolor": "#653",
"shape": 1
},
{
"id": 11,
"type": "show_text_party",
"pos": [
1390,
300
],
"size": {
"0": 480,
"1": 850
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "text",
"type": "STRING",
"link": 47,
"widget": {
"name": "text"
},
"label": "text"
}
],
"outputs": [
{
"name": "STRING",
"type": "STRING",
"links": null,
"shape": 6,
"label": "STRING"
}
],
"properties": {
"Node name for S&R": "show_text_party"
},
"widgets_values": [
"",
"大型语言模型派对"
],
"color": "#233",
"bgcolor": "#355",
"shape": 1
}
],
"links": [
[
47,
32,
0,
11,
0,
"STRING"
],
[
49,
22,
0,
32,
0,
"CUSTOM"
],
[
50,
22,
1,
32,
1,
"CUSTOM"
],
[
51,
32,
0,
38,
0,
"*"
],
[
52,
22,
0,
38,
1,
"CUSTOM"
],
[
53,
22,
1,
38,
2,
"CUSTOM"
]
],
"groups": [
{
"title": "LLM_Party for Local Models",
"bounding": [
450,
70,
1433,
137
],
"color": "#3f789e",
"font_size": 100,
"locked": false
},
{
"title": "Local LLM Config",
"bounding": [
450,
220,
430,
950
],
"color": "#3f789e",
"font_size": 24,
"locked": false
},
{
"title": "LLM_Local Apply",
"bounding": [
890,
220,
480,
950
],
"color": "#3f789e",
"font_size": 24,
"locked": false
},
{
"title": "OutPut",
"bounding": [
1380,
220,
500,
950
],
"color": "#3f789e",
"font_size": 24,
"locked": false
}
],
"config": {},
"extra": {
"ds": {
"scale": 0.8769226950000013,
"offset": {
"0": 320.51392051716937,
"1": -35.42365160443333
}
}
},
"version": 0.4
}