Flowise

Форк
0
/
HuggingFace LLM Chain.json 
316 строк · 13.5 Кб
1
{
2
    "description": "Simple LLM Chain using HuggingFace Inference API on falcon-7b-instruct model",
3
    "categories": "HuggingFace,LLM Chain,Langchain",
4
    "framework": "Langchain",
5
    "nodes": [
6
        {
7
            "width": 300,
8
            "height": 475,
9
            "id": "promptTemplate_0",
10
            "position": {
11
                "x": 506.50436294210306,
12
                "y": 504.50766458127396
13
            },
14
            "type": "customNode",
15
            "data": {
16
                "id": "promptTemplate_0",
17
                "label": "Prompt Template",
18
                "version": 1,
19
                "name": "promptTemplate",
20
                "type": "PromptTemplate",
21
                "baseClasses": ["PromptTemplate", "BaseStringPromptTemplate", "BasePromptTemplate"],
22
                "category": "Prompts",
23
                "description": "Schema to represent a basic prompt for an LLM",
24
                "inputParams": [
25
                    {
26
                        "label": "Template",
27
                        "name": "template",
28
                        "type": "string",
29
                        "rows": 4,
30
                        "placeholder": "What is a good name for a company that makes {product}?",
31
                        "id": "promptTemplate_0-input-template-string"
32
                    },
33
                    {
34
                        "label": "Format Prompt Values",
35
                        "name": "promptValues",
36
                        "type": "json",
37
                        "optional": true,
38
                        "acceptVariable": true,
39
                        "list": true,
40
                        "id": "promptTemplate_0-input-promptValues-json"
41
                    }
42
                ],
43
                "inputAnchors": [],
44
                "inputs": {
45
                    "template": "Question: {question}\n\nAnswer: Let's think step by step.",
46
                    "promptValues": ""
47
                },
48
                "outputAnchors": [
49
                    {
50
                        "id": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
51
                        "name": "promptTemplate",
52
                        "label": "PromptTemplate",
53
                        "type": "PromptTemplate | BaseStringPromptTemplate | BasePromptTemplate"
54
                    }
55
                ],
56
                "outputs": {},
57
                "selected": false
58
            },
59
            "selected": false,
60
            "positionAbsolute": {
61
                "x": 506.50436294210306,
62
                "y": 504.50766458127396
63
            },
64
            "dragging": false
65
        },
66
        {
67
            "width": 300,
68
            "height": 577,
69
            "id": "huggingFaceInference_LLMs_0",
70
            "position": {
71
                "x": 498.8594464193537,
72
                "y": -94.91050256311678
73
            },
74
            "type": "customNode",
75
            "data": {
76
                "id": "huggingFaceInference_LLMs_0",
77
                "label": "HuggingFace Inference",
78
                "version": 2,
79
                "name": "huggingFaceInference_LLMs",
80
                "type": "HuggingFaceInference",
81
                "baseClasses": ["HuggingFaceInference", "LLM", "BaseLLM", "BaseLanguageModel"],
82
                "category": "LLMs",
83
                "description": "Wrapper around HuggingFace large language models",
84
                "inputParams": [
85
                    {
86
                        "label": "Connect Credential",
87
                        "name": "credential",
88
                        "type": "credential",
89
                        "credentialNames": ["huggingFaceApi"],
90
                        "id": "huggingFaceInference_LLMs_0-input-credential-credential"
91
                    },
92
                    {
93
                        "label": "Model",
94
                        "name": "model",
95
                        "type": "string",
96
                        "description": "If using own inference endpoint, leave this blank",
97
                        "placeholder": "gpt2",
98
                        "optional": true,
99
                        "id": "huggingFaceInference_LLMs_0-input-model-string"
100
                    },
101
                    {
102
                        "label": "Endpoint",
103
                        "name": "endpoint",
104
                        "type": "string",
105
                        "placeholder": "https://xyz.eu-west-1.aws.endpoints.huggingface.cloud/gpt2",
106
                        "description": "Using your own inference endpoint",
107
                        "optional": true,
108
                        "id": "huggingFaceInference_LLMs_0-input-endpoint-string"
109
                    },
110
                    {
111
                        "label": "Temperature",
112
                        "name": "temperature",
113
                        "type": "number",
114
                        "description": "Temperature parameter may not apply to certain model. Please check available model parameters",
115
                        "optional": true,
116
                        "additionalParams": true,
117
                        "id": "huggingFaceInference_LLMs_0-input-temperature-number"
118
                    },
119
                    {
120
                        "label": "Max Tokens",
121
                        "name": "maxTokens",
122
                        "type": "number",
123
                        "description": "Max Tokens parameter may not apply to certain model. Please check available model parameters",
124
                        "optional": true,
125
                        "additionalParams": true,
126
                        "id": "huggingFaceInference_LLMs_0-input-maxTokens-number"
127
                    },
128
                    {
129
                        "label": "Top Probability",
130
                        "name": "topP",
131
                        "type": "number",
132
                        "description": "Top Probability parameter may not apply to certain model. Please check available model parameters",
133
                        "optional": true,
134
                        "additionalParams": true,
135
                        "id": "huggingFaceInference_LLMs_0-input-topP-number"
136
                    },
137
                    {
138
                        "label": "Top K",
139
                        "name": "hfTopK",
140
                        "type": "number",
141
                        "description": "Top K parameter may not apply to certain model. Please check available model parameters",
142
                        "optional": true,
143
                        "additionalParams": true,
144
                        "id": "huggingFaceInference_LLMs_0-input-hfTopK-number"
145
                    },
146
                    {
147
                        "label": "Frequency Penalty",
148
                        "name": "frequencyPenalty",
149
                        "type": "number",
150
                        "description": "Frequency Penalty parameter may not apply to certain model. Please check available model parameters",
151
                        "optional": true,
152
                        "additionalParams": true,
153
                        "id": "huggingFaceInference_LLMs_0-input-frequencyPenalty-number"
154
                    }
155
                ],
156
                "inputAnchors": [
157
                    {
158
                        "label": "Cache",
159
                        "name": "cache",
160
                        "type": "BaseCache",
161
                        "optional": true,
162
                        "id": "huggingFaceInference_LLMs_0-input-cache-BaseCache"
163
                    }
164
                ],
165
                "inputs": {
166
                    "model": "tiiuae/falcon-7b-instruct",
167
                    "endpoint": "",
168
                    "temperature": "",
169
                    "maxTokens": "",
170
                    "topP": "",
171
                    "hfTopK": "",
172
                    "frequencyPenalty": ""
173
                },
174
                "outputAnchors": [
175
                    {
176
                        "id": "huggingFaceInference_LLMs_0-output-huggingFaceInference_LLMs-HuggingFaceInference|LLM|BaseLLM|BaseLanguageModel",
177
                        "name": "huggingFaceInference_LLMs",
178
                        "label": "HuggingFaceInference",
179
                        "type": "HuggingFaceInference | LLM | BaseLLM | BaseLanguageModel"
180
                    }
181
                ],
182
                "outputs": {},
183
                "selected": false
184
            },
185
            "selected": false,
186
            "positionAbsolute": {
187
                "x": 498.8594464193537,
188
                "y": -94.91050256311678
189
            },
190
            "dragging": false
191
        },
192
        {
193
            "width": 300,
194
            "height": 456,
195
            "id": "llmChain_0",
196
            "position": {
197
                "x": 909.6249320819859,
198
                "y": 338.9520801783737
199
            },
200
            "type": "customNode",
201
            "data": {
202
                "id": "llmChain_0",
203
                "label": "LLM Chain",
204
                "version": 3,
205
                "name": "llmChain",
206
                "type": "LLMChain",
207
                "baseClasses": ["LLMChain", "BaseChain", "Runnable"],
208
                "category": "Chains",
209
                "description": "Chain to run queries against LLMs",
210
                "inputParams": [
211
                    {
212
                        "label": "Chain Name",
213
                        "name": "chainName",
214
                        "type": "string",
215
                        "placeholder": "Name Your Chain",
216
                        "optional": true,
217
                        "id": "llmChain_0-input-chainName-string"
218
                    }
219
                ],
220
                "inputAnchors": [
221
                    {
222
                        "label": "Language Model",
223
                        "name": "model",
224
                        "type": "BaseLanguageModel",
225
                        "id": "llmChain_0-input-model-BaseLanguageModel"
226
                    },
227
                    {
228
                        "label": "Prompt",
229
                        "name": "prompt",
230
                        "type": "BasePromptTemplate",
231
                        "id": "llmChain_0-input-prompt-BasePromptTemplate"
232
                    },
233
                    {
234
                        "label": "Output Parser",
235
                        "name": "outputParser",
236
                        "type": "BaseLLMOutputParser",
237
                        "optional": true,
238
                        "id": "llmChain_0-input-outputParser-BaseLLMOutputParser"
239
                    },
240
                    {
241
                        "label": "Input Moderation",
242
                        "description": "Detect text that could generate harmful output and prevent it from being sent to the language model",
243
                        "name": "inputModeration",
244
                        "type": "Moderation",
245
                        "optional": true,
246
                        "list": true,
247
                        "id": "llmChain_0-input-inputModeration-Moderation"
248
                    }
249
                ],
250
                "inputs": {
251
                    "model": "{{huggingFaceInference_LLMs_0.data.instance}}",
252
                    "prompt": "{{promptTemplate_0.data.instance}}",
253
                    "outputParser": "",
254
                    "chainName": "",
255
                    "inputModeration": ""
256
                },
257
                "outputAnchors": [
258
                    {
259
                        "name": "output",
260
                        "label": "Output",
261
                        "type": "options",
262
                        "options": [
263
                            {
264
                                "id": "llmChain_0-output-llmChain-LLMChain|BaseChain|Runnable",
265
                                "name": "llmChain",
266
                                "label": "LLM Chain",
267
                                "type": "LLMChain | BaseChain | Runnable"
268
                            },
269
                            {
270
                                "id": "llmChain_0-output-outputPrediction-string|json",
271
                                "name": "outputPrediction",
272
                                "label": "Output Prediction",
273
                                "type": "string | json"
274
                            }
275
                        ],
276
                        "default": "llmChain"
277
                    }
278
                ],
279
                "outputs": {
280
                    "output": "llmChain"
281
                },
282
                "selected": false
283
            },
284
            "selected": false,
285
            "positionAbsolute": {
286
                "x": 909.6249320819859,
287
                "y": 338.9520801783737
288
            },
289
            "dragging": false
290
        }
291
    ],
292
    "edges": [
293
        {
294
            "source": "huggingFaceInference_LLMs_0",
295
            "sourceHandle": "huggingFaceInference_LLMs_0-output-huggingFaceInference_LLMs-HuggingFaceInference|LLM|BaseLLM|BaseLanguageModel",
296
            "target": "llmChain_0",
297
            "targetHandle": "llmChain_0-input-model-BaseLanguageModel",
298
            "type": "buttonedge",
299
            "id": "huggingFaceInference_LLMs_0-huggingFaceInference_LLMs_0-output-huggingFaceInference_LLMs-HuggingFaceInference|LLM|BaseLLM|BaseLanguageModel-llmChain_0-llmChain_0-input-model-BaseLanguageModel",
300
            "data": {
301
                "label": ""
302
            }
303
        },
304
        {
305
            "source": "promptTemplate_0",
306
            "sourceHandle": "promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate",
307
            "target": "llmChain_0",
308
            "targetHandle": "llmChain_0-input-prompt-BasePromptTemplate",
309
            "type": "buttonedge",
310
            "id": "promptTemplate_0-promptTemplate_0-output-promptTemplate-PromptTemplate|BaseStringPromptTemplate|BasePromptTemplate-llmChain_0-llmChain_0-input-prompt-BasePromptTemplate",
311
            "data": {
312
                "label": ""
313
            }
314
        }
315
    ]
316
}
317

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.