Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
hf-vb (Hugging Face - Visual Blocks)
[go: Go Back, main page]

\n \n \"transformers.js\n \n
\n

\n\nVisual blocks is an amazing tool from our friends at [Google](https://github.com/google/visualblocks)\nthat allows you to easily create and experiment with machine learning pipelines using a visual interface.\nThis repository contains the source code for custom components that allow you to use Hugging Face client and server models in your Visual Blocks pipelines.\nWe've created a few nodes supporting different tasks and models following our [Tasks](https://huggingface.co/tasks) definitions.\n\n> [!NOTE]\n> 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.\n\nImportant links:\n\n- https://visualblocks.withgoogle.com\n- https://github.com/huggingface/visual-blocks-custom-components\n- https://www.npmjs.com/package/huggingface-visualblocks-nodes\n- https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest\n\n
\n Table of Contents\n\n- [How to use the custom components](#how-to-use-the-custom-components)\n- [Nodes and Examples](#nodes-and-examples)\n - [Client Nodes](#client-nodes)\n - [Translation](#translation)\n - [Token Classification](#token-classification)\n - [Text Classification](#text-classification)\n - [Object Detection](#object-detection)\n - [Image Segmentation](#image-segmentation)\n - [Image Classification](#image-classification)\n - [Depth Estimation](#depth-estimation)\n - [Background Removal](#background-removal)\n - [Server Nodes](#server-nodes)\n - [Text Generation and Chat Completion](#text-generation-and-chat-completion)\n - [Fill Mask](#fill-mask)\n - [Image Classification](#image-classification-1)\n - [Summarization](#summarization)\n - [Text Classification](#text-classification-1)\n - [Text Generation](#text-generation)\n - [Text to Image](#text-to-image)\n - [Token Classification](#token-classification-1)\n - [Extra Examples](#extra-examples)\n- [Local Development](#local-development)\n\n
\n\n## How to use the custom components\n\nTo 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.\n\n\n\nThen 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\":\n\n```\nhttps://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest\n```\n\n\n\nThen you will be able to see three Hugging Face Collections: Client, Server and Common.\n\n\n\n# Nodes and Examples\n\n## Client Nodes\n\nClient nodes are nodes running tranformers pipelines on the client side using [Transformers.js](https://github.com/xenova/transformers.js). All Client nodes have WASM and WebGPU (experimental) backend support, and you can find web-compatible models by visiting https://huggingface.co/models?library=transformers.js.\n\n> [!NOTE]\n> WebGPU support in transformers.js is still experimental and may not work on all devices. Not all models are supported by WebGPU backend yet.\n\n### Translation\n\n\n\n[**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)\n\nMore info:\n\n- https://huggingface.co/tasks/translation\n- https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TranslationPipeline\n\n### Token Classification\n\n\n\n[**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)\n\nMore info:\n\n- https://huggingface.co/tasks/token-classification\n- https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TokenClassificationPipeline\n\n### Text Classification\n\n\n\n[**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)\n\nMore info:\n\n- https://huggingface.co/tasks/text-classification\n- https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TextClassificationPipeline\n\n### Object Detection\n\n\n\n[**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)\n\nMore info:\n\n- https://huggingface.co/tasks/object-detection\n- https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.ObjectDetectionPipeline\n\n### Image Segmentation\n\n\n\n[**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)\n\nMore info:\n\n- https://huggingface.co/tasks/image-segmentation\n- https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.ImageSegmentationPipeline\n\n### Image Classification\n\n\n\n[**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)\n\nMore info:\n\n- https://huggingface.co/tasks/image-classification\n- https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.ImageClassificationPipeline\n\n### Depth Estimation\n\n\n\n[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)\n\nMore info:\n\n- https://huggingface.co/tasks/depth-estimation\n- https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.DepthEstimationPipeline\n\n### Background Removal\n\n\n\n[**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)\n\n## Server Nodes\n\nServer 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.\n\n> [!NOTE]\n> 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.\n\nFor 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**\n\n\n\n\n\n\n\nIf successful, you can obtain your **Apikey** directly from the **Hugging Face Hub Login** node.\n\n\n\n### Text Generation and Chat Completion\n\n\n\n[**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)\n\n\n\n[**Chat Completion Node Example**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/server/chat_completion_server_.json)\n\nMore info:\n\n- https://huggingface.co/tasks/text-generation\n\n### Fill Mask\n\n\n\n[**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)\n\nMore info:\n\n- https://huggingface.co/tasks/fill-mask\n\n### Image Classification\n\n\n\n[**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)\n\nMore info:\n\n- https://huggingface.co/tasks/image-classification\n\n### Summarization\n\n\n\n[**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)\n\nMore info:\n\n- https://huggingface.co/tasks/summarization\n\n### Text Classification\n\n\n\n[**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)\n\nMore info:\n\n- https://huggingface.co/tasks/text-classification\n\n### Text Generation\n\n\n\n[**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)\n\nMore info:\n\n- https://huggingface.co/tasks/text-generation\n\n### Text to Image\n\n\n\n[**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)\n\nMore info:\n\n- https://huggingface.co/tasks/text-to-image\n\n### Token Classification\n\n\n\n[**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)\n\nMore info:\n\n- https://huggingface.co/tasks/token-classification\n\n## Extra Examples\n\n[**Background Removal Text to Image**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/extras/background_removal_text_to_image.json)\n\n[**Chat Completion Text to Image Depth**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/extras/chat_completion_txt2img_depth.json)\n\n[**Image Segmentation Webcam Client**](https://visualblocks.withgoogle.com/#/edit/new_hfdemo?project_json=https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest/examples/extras/image_segmentation_webcam_client.json)\n\n# Local Development\n\n1. Clone the repository\n\n ```bash\n git clone https://github.com/huggingface/visual-blocks-custom-components.git\n cd visual-blocks-custom-components\n ```\n\n2. Install the dependencies\n\n ```bash\n npm i\n ```\n\n3. Run the development server\n\n ```bash\n npm run dev\n ```\n\n4. Visit Google's staging server\n\n5. Click the + in the bottom left corner to add the custom nodes.\n\n6. Paste in the link to the script (e.g., http://localhost:8080/index.js) and click \"Submit\".","html":"

Hugging Face + Visual Blocks Custom Components

\n

\n
\n \n \n \n \"transformers.js\n \n
\n

\n\n

Visual blocks is an amazing tool from our friends at Google\nthat allows you to easily create and experiment with machine learning pipelines using a visual interface.\nThis repository contains the source code for custom components that allow you to use Hugging Face client and server models in your Visual Blocks pipelines.\nWe've created a few nodes supporting different tasks and models following our Tasks definitions.

\n
\n

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 to the Visual Blocks team.

\n
\n

Important links:

\n\n
\n Table of Contents\n\n\n
\n\n

How to use the custom components

\n

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, then click on the \"+\" button in the bottom left corner to add a new node.

\n\n\n

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\":

\n
https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest\n
\n\n\n

Then you will be able to see three Hugging Face Collections: Client, Server and Common.

\n\n\n

Nodes and Examples

\n

Client Nodes

\n

Client nodes are nodes running tranformers pipelines on the client side using Transformers.js. All Client nodes have WASM and WebGPU (experimental) backend support, and you can find web-compatible models by visiting https://huggingface.co/models?library=transformers.js.

\n
\n

WebGPU support in transformers.js is still experimental and may not work on all devices. Not all models are supported by WebGPU backend yet.

\n
\n

Translation

\n\n\n

Translation Node Example

\n

More info:

\n\n

Token Classification

\n\n\n

Token Classification Node Example

\n

More info:

\n\n

Text Classification

\n\n\n

Text Classification Node Example

\n

More info:

\n\n

Object Detection

\n\n\n

Object Detection Node Example

\n

More info:

\n\n

Image Segmentation

\n\n\n

Image Segmentation Node Example

\n

More info:

\n\n

Image Classification

\n\n\n

Image Classification Node Example

\n

More info:

\n\n

Depth Estimation

\n\n\n

Depth Estimation Node Example

\n

More info:

\n\n

Background Removal

\n\n\n

Background Removal Node Example

\n

Server Nodes

\n

Server nodes are nodes running Transformers pipeline tasks using the Hugging Face Serverless API. For a few selected LLM models, it's running using our hosted Text Generation Inference, our fast, optimized inference for LLMs.

\n
\n

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.

\n
\n

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

\n\n\n\n\n\n\n

If successful, you can obtain your Apikey directly from the Hugging Face Hub Login node.

\n\n\n

Text Generation and Chat Completion

\n\n\n

Chat Template Text Generation Node Example

\n\n\n

Chat Completion Node Example

\n

More info:

\n\n

Fill Mask

\n\n\n

Fill Mask Node Example

\n

More info:

\n\n

Image Classification

\n\n\n

Image Classification Node Example

\n

More info:

\n\n

Summarization

\n\n\n

Summarization Node Example

\n

More info:

\n\n

Text Classification

\n\n\n

Text Classification Node Example

\n

More info:

\n\n

Text Generation

\n\n\n

Text Generation Node Example

\n

More info:

\n\n

Text to Image

\n\n\n

Text to Image Node Example

\n

More info:

\n\n

Token Classification

\n\n\n

Token Classification Node Example

\n

More info:

\n\n

Extra Examples

\n

Background Removal Text to Image

\n

Chat Completion Text to Image Depth

\n

Image Segmentation Webcam Client

\n

Local Development

\n
    \n
  1. Clone the repository

    \n
    git clone https://github.com/huggingface/visual-blocks-custom-components.git\ncd visual-blocks-custom-components\n
    \n
  2. \n
  3. Install the dependencies

    \n
    npm i\n
    \n
  4. \n
  5. Run the development server

    \n
    npm run dev\n
    \n
  6. \n
  7. Visit Google's staging server

    \n
  8. \n
  9. Click the + in the bottom left corner to add the custom nodes.

    \n
  10. \n
  11. Paste in the link to the script (e.g., http://localhost:8080/index.js) and click \"Submit\".

    \n
  12. \n
\n","classNames":"hf-sanitized hf-sanitized-uUk28JDE6flYj_1xz8CtO"},"users":[{"_id":"6064e095abd8d3692e3e2ed6","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/1648966381588-6064e095abd8d3692e3e2ed6.jpeg","isPro":true,"fullname":"Radamés Ajna","user":"radames","type":"user"},{"_id":"61b253b7ac5ecaae3d1efe0c","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/61b253b7ac5ecaae3d1efe0c/hwiQ0uvz3t-L5a-NtBIO6.png","isPro":false,"fullname":"Joshua","user":"Xenova","type":"user"},{"_id":"65fb30df82254f113f49d40c","avatarUrl":"https://cdn-avatars.huggingface.co/v1/production/uploads/noauth/DIM8hXUgBLMqq0ceKyeOm.jpeg","isPro":false,"fullname":"Jason Mayes","user":"JasonMayes","type":"user"}],"userCount":3,"collections":[],"datasets":[],"models":[],"paperPreviews":[],"spaces":[],"buckets":[],"numBuckets":0,"numDatasets":0,"numModels":0,"numSpaces":1,"lastOrgActivities":[],"acceptLanguages":["*"],"canReadRepos":false,"canReadSpaces":false,"blogPosts":[],"currentRepoPage":0,"filters":{},"paperView":false}">

AI & ML interests

None defined yet.

Hugging Face + Visual Blocks Custom Components


transformers.js javascript library logo

Visual blocks is an amazing tool from our friends at Google 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. We've created a few nodes supporting different tasks and models following our Tasks definitions.

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 to the Visual Blocks team.

Important links:

Table of Contents

How to use the custom components

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, then click on the "+" button in the bottom left corner to add a new node.

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":

https://cdn.jsdelivr.net/npm/huggingface-visualblocks-nodes@latest

Then you will be able to see three Hugging Face Collections: Client, Server and Common.

Nodes and Examples

Client Nodes

Client nodes are nodes running tranformers pipelines on the client side using Transformers.js. All Client nodes have WASM and WebGPU (experimental) backend support, and you can find web-compatible models by visiting https://huggingface.co/models?library=transformers.js.

WebGPU support in transformers.js is still experimental and may not work on all devices. Not all models are supported by WebGPU backend yet.

Translation

Translation Node Example

More info:

Token Classification

Token Classification Node Example

More info:

Text Classification

Text Classification Node Example

More info:

Object Detection

Object Detection Node Example

More info:

Image Segmentation

Image Segmentation Node Example

More info:

Image Classification

Image Classification Node Example

More info:

Depth Estimation

Depth Estimation Node Example

More info:

Background Removal

Background Removal Node Example

Server Nodes

Server nodes are nodes running Transformers pipeline tasks using the Hugging Face Serverless API. For a few selected LLM models, it's running using our hosted Text Generation Inference, our fast, optimized inference for LLMs.

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.

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

If successful, you can obtain your Apikey directly from the Hugging Face Hub Login node.

Text Generation and Chat Completion

Chat Template Text Generation Node Example

Chat Completion Node Example

More info:

Fill Mask

Fill Mask Node Example

More info:

Image Classification

Image Classification Node Example

More info:

Summarization

Summarization Node Example

More info:

Text Classification

Text Classification Node Example

More info:

Text Generation

Text Generation Node Example

More info:

Text to Image

Text to Image Node Example

More info:

Token Classification

Token Classification Node Example

More info:

Extra Examples

Background Removal Text to Image

Chat Completion Text to Image Depth

Image Segmentation Webcam Client

Local Development

  1. Clone the repository

    git clone https://github.com/huggingface/visual-blocks-custom-components.git
    cd visual-blocks-custom-components
    
  2. Install the dependencies

    npm i
    
  3. Run the development server

    npm run dev
    
  4. Visit Google's staging server

  5. Click the + in the bottom left corner to add the custom nodes.

  6. Paste in the link to the script (e.g., http://localhost:8080/index.js) and click "Submit".

models 0

None public yet

datasets 0

None public yet