radames commited on
Commit
c0187ee
·
verified ·
1 Parent(s): f663f2e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +280 -0
README.md CHANGED
@@ -6,6 +6,286 @@ colorTo: red
6
  sdk: static
7
  pinned: false
8
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  # Hugging Face and Google Visual Blocks
11
 
 
6
  sdk: static
7
  pinned: false
8
  ---
9
+ # Hugging Face + Visual Blocks Custom Components
10
+
11
+ <img src="https://huggingface.co/spaces/hf-vb/README/raw/main/hf-vb-logo.svg" width="250">
12
+
13
+ Visual blocks is an amazing tool from our friends at [Google](https://github.com/google/visualblocks)
14
+ that allows you to easily create and experiment with machine learning pipelines using a visual interface. This repository contains the source code for custom components that allow you to use Hugging Face client and server models in your Visual Blocks pipelines.
15
+ We've created a few nodes supporting different tasks and models following our [Tasks](https://huggingface.co/tasks) definitions.
16
+
17
+ > [!NOTE]
18
+ > Visual Blocks seems to be mostly working in Chrome. If you are having trouble with the interface, try using Chrome, and please submit an [issue](https://github.com/google/visualblocks/issues) to the Visual Blocks team.
19
+
20
+ Important links:
21
+
22
+ - https://visualblocks.withgoogle.com/
23
+ - https://www.npmjs.com/package/huggingface-visualblocks-nodes
24
+ - https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest
25
+
26
+ <details>
27
+ <summary> Table of Contents</summary>
28
+
29
+ - [How to use the custom components](#how-to-use-the-custom-components)
30
+ - [Nodes and Examples](#nodes-and-examples)
31
+ - [Client Nodes](#client-nodes)
32
+ - [Translation](#translation)
33
+ - [Token Classification](#token-classification)
34
+ - [Text Classification](#text-classification)
35
+ - [Object Detection](#object-detection)
36
+ - [Image Segmentation](#image-segmentation)
37
+ - [Image Classification](#image-classification)
38
+ - [Depth Estimation](#depth-estimation)
39
+ - [Background Removal](#background-removal)
40
+ - [Server Nodes](#server-nodes)
41
+ - [Text Generation and Chat Completion](#text-generation-and-chat-completion)
42
+ - [Fill Mask](#fill-mask)
43
+ - [Image Classification](#image-classification-1)
44
+ - [Summarization](#summarization)
45
+ - [Text Classification](#text-classification-1)
46
+ - [Text Generation](#text-generation)
47
+ - [Text to Image](#text-to-image)
48
+ - [Token Classification](#token-classification-1)
49
+ - [Local Development](#local-development)
50
+
51
+ </details>
52
+
53
+ ## How to use the custom components
54
+
55
+ To start playing with our custom components you need to Add a custom node to your Visual Blocks project. First you need to start a new project [https://visualblocks.withgoogle.com/#/edit/new](https://visualblocks.withgoogle.com/#/edit/new), then click on the "+" button in the bottom left corner to add a new node.
56
+
57
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/left_button.png" width="150">
58
+
59
+ Then input the pre-bundled code from our npm package. You can do this by pasting the following link into the input field and clicking "Submit":
60
+
61
+ ```js
62
+ https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest
63
+ ```
64
+
65
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/custom_node.jpg" width="400">
66
+
67
+ Then you will be able to see three Hugging Face Collections: Client, Server and Common.
68
+
69
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/collections.jpg" width="200">
70
+
71
+ # Nodes and Examples
72
+
73
+ ## Client Nodes
74
+
75
+ Client nodes are nodes running tranformers pipelines on the client side using [Transformers.js](https://github.com/xenova/transformers.js) library. All Client nodes have an experimental WebGPU and WASM backend support, and models listed in the [Xenova](https://huggingface.co/Xenova) profile are supported.
76
+
77
+ > [!NOTE]
78
+ > WebGPU support on transformers.js is experimental and may not work on all devices, not all models are supported by WebGPU backend yet.
79
+
80
+ ### Translation
81
+
82
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/translation.jpg" width="400">
83
+
84
+ [**Translation Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/client/translation_client_.json)
85
+
86
+ More info:
87
+
88
+ - https://huggingface.co/tasks/translation
89
+ - https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TranslationPipeline
90
+
91
+ ### Token Classification
92
+
93
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/token.jpg" width="400">
94
+
95
+ [**Token Classification Node Exampl**e](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/client/token_classification_client_.json)
96
+
97
+ More info:
98
+
99
+ - https://huggingface.co/tasks/token-classification
100
+ - https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TokenClassificationPipeline
101
+
102
+ ### Text Classification
103
+
104
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/text-classification.jpg" width="400">
105
+
106
+ [**Text Classification Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/client/text_classification_client_.json)
107
+
108
+ More info:
109
+
110
+ - https://huggingface.co/tasks/text-classification
111
+ - https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TextClassificationPipeline
112
+
113
+ ### Object Detection
114
+
115
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/object-detc.jpg" width="400">
116
+
117
+ [**Object Detection Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/client/object_detection_client_.json)
118
+
119
+ More info:
120
+
121
+ - https://huggingface.co/tasks/object-detection
122
+ - https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.ObjectDetectionPipeline
123
+
124
+ ### Image Segmentation
125
+
126
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/segment.jpg" width="400">
127
+
128
+ [**Image Segmentation Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/client/image_segmentation_client_.json)
129
+
130
+ More info:
131
+
132
+ - https://huggingface.co/tasks/image-segmentation
133
+ - https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.ImageSegmentationPipeline
134
+
135
+ ### Image Classification
136
+
137
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/class.jpg" width="400">
138
+
139
+ [**Image Classification Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/client/image_classification_client_.json)
140
+
141
+ More info:
142
+
143
+ - https://huggingface.co/tasks/image-classification
144
+ - https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.ImageClassificationPipeline
145
+
146
+ ### Depth Estimation
147
+
148
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/dept-es.jpg" width="400">
149
+
150
+ [Depth Estimation Node Example](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/client/depth_estimation_client_.json)
151
+
152
+ More info:
153
+
154
+ - https://huggingface.co/tasks/depth-estimation
155
+ - https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.DepthEstimationPipeline
156
+
157
+ ### Background Removal
158
+
159
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/removal.jpg" width="400">
160
+
161
+ [**Background Removal Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/client/background_removal_client_.json)
162
+
163
+ ## Server Nodes
164
+
165
+ Server nodes are nodes running Transformers pipeline tasks using the [Hugging Face Serverless API](https://huggingface.co/docs/api-inference/en/index). For a few selected LLM models, it's running using our hosted [Text Generation Inference](https://huggingface.co/docs/text-generation-inference/en/index), our fast, optimized inference for LLMs.
166
+
167
+ > [!NOTE]
168
+ > You can use the Hugging Face Serverless API for free with limited usage, after which you'll be rate limited. If you need more usage, you can create an account at https://huggingface.co/join and get an API token at https://huggingface.co/settings/tokens or log in using the Hugging Face Login node.
169
+
170
+ For server nodes you have the option to Login using your Hugging Face account to get more usage and access to private models. Using **Hugging Face Hub Login**
171
+
172
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/server/button-auth.jpg" width="150">
173
+
174
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/server/auth.jpg" width="300">
175
+
176
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/server/button-logged.jpg" width="150">
177
+
178
+ If successful, you can **Apikey** directly from the **Hugging Face Hub Login** node.
179
+
180
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/server/logged.jpg" width="350">
181
+
182
+ ### Text Generation and Chat Completion
183
+
184
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/server/chat-template.jpg" width="400">
185
+
186
+ [**Chat Template Text Generation Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/server/chat_template_text_generation_server_.json)
187
+
188
+ More info:
189
+
190
+ - https://huggingface.co/tasks/text-generation
191
+
192
+ ### Fill Mask
193
+
194
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/server/fill-mask.jpg" width="400">
195
+
196
+ [**Fill Mask Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/server/fill_mask_server_.json)
197
+
198
+ More info:
199
+
200
+ - https://huggingface.co/tasks/fill-mask
201
+
202
+ ### Image Classification
203
+
204
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/server/image-class.jpg" width="400">
205
+
206
+ [**Image Classification Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/server/image_classification_server_.json)
207
+
208
+ More info:
209
+
210
+ - https://huggingface.co/tasks/image-classification
211
+
212
+ ### Summarization
213
+
214
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/server/summarization.jpg" width="400">
215
+
216
+ [**Summarization Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/server/summarization_server_.json)
217
+
218
+ More info:
219
+
220
+ - https://huggingface.co/tasks/summarization
221
+
222
+ ### Text Classification
223
+
224
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/server/text-class.jpg" width="400">
225
+
226
+ [**Text Classification Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/server/text_classification_server_.json)
227
+
228
+ More info:
229
+
230
+ - https://huggingface.co/tasks/text-classification
231
+
232
+ ### Text Generation
233
+
234
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/server/text-generation.jpg" width="400">
235
+
236
+ [**Text Generation Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/server/text_generation_server_.json)
237
+
238
+ More info:
239
+
240
+ - https://huggingface.co/tasks/text-generation
241
+
242
+ ### Text to Image
243
+
244
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/server/text-to-image.jpg" width="400">
245
+
246
+ [**Text to Image Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/server/text_to_image_server_.json)
247
+
248
+ More info:
249
+
250
+ - https://huggingface.co/tasks/text-to-image
251
+
252
+ ### Token Classification
253
+
254
+ <img src="https://huggingface.co/spaces/hf-vb/README/resolve/main/server/token-class.jpg" width="400">
255
+
256
+ [**Token Classification Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/server/token_classification_server_.json)
257
+
258
+ More info:
259
+
260
+ - https://huggingface.co/tasks/token-classification
261
+
262
+ # Local Development
263
+
264
+ 1. Clone the repository
265
+
266
+ ```bash
267
+ git clone https://github.com/huggingface/visual-blocks-custom-components.git
268
+ cd visual-blocks-custom-components
269
+ ```
270
+
271
+ 2. Install the dependencies
272
+
273
+ ```bash
274
+ npm i
275
+ ```
276
+
277
+ 3. Run the development server
278
+
279
+ ```bash
280
+ npm run dev
281
+ ```
282
+
283
+ 4. Visit Google's staging server
284
+
285
+ 5. Click the + in the bottom left corner to add the custom nodes.
286
+
287
+ 6. Paste in the link to the script (http://localhost:8080/index.js) and click "Submit".
288
+
289
 
290
  # Hugging Face and Google Visual Blocks
291