top of page

Gino News

terça-feira, 26 de novembro de 2024

Implantação Segura de Modelos com Inference Endpoints e Custom Handlers

Tecnologia Inteligência Artificial Desenvolvimento de Software

A Hugging Face anunciou uma solução de implantação segura chamada Inference Endpoints, que permite a utilização de modelos Transformers, Sentence-Transformers e Diffusers com handlers personalizados, proporcionando flexibilidade e controle sobre o processamento de inferências.

A detailed, vector-style illustration in a corporate, flat style set against a white, textureless background. The image is depicted in a 2D, linear perspective and demonstrates the secure deployment process of models using Inference Endpoints. This includes the setup of Custom Handlers, shown symbolically with snippets of Python code. Infrastructure graphics are included to illustrate the scalability and security of the services, accompanied by logos of a generic AI technology brand (Do not use Hugging Face logo) for brand identification. Please avoid using any material that could be copyrighted.

Imagem gerada utilizando Dall-E 3

Os Inference Endpoints oferecem uma infraestrutura dedicada e escalável, gerida pela Hugging Face, que simplifica a implementação de modelos a partir do Hugging Face Hub. Este serviço é projetado para suportar a execução de código personalizado por meio de um handler, permitindo que usuários adaptem as etapas de pré-processamento, inferência e pós-processamento conforme suas necessidades específicas.


Os Custom Handlers são classes de Python que definem as etapas essenciais para executar a inferência em cima de um modelo. Estas classes ampliam a funcionalidade dos Inference Endpoints, permitindo ajustes em processos, inclusão de dependências e implementação de métricas personalizadas, proporcionando uma solução que se adapta às necessidades particulares de cada usuário.


Para iniciar o uso de handlers personalizados, os usuários podem duplicar repositórios de modelos ou criar novos repositórios contendo arquivos essenciais como handler.py e requirements.txt. Estes devem ser configurados corretamente para que sejam detectados automaticamente no backend dos Inference Endpoints, facilitando a implantação dos modelos desejados.


  1. Duplicação de repositórios com pesos de modelos.

  2. Abertura de Pull Request para inclusão de handlers.

  3. Criação de novos repositórios apenas para handlers.

  4. Configuração do arquivo README.md para habilitar o botão 'Deploy'.

  5. Implementação correta da classe EndpointHandler em handler.py.


A flexibilidade dos Custom Handlers é destacada em diversas aplicações, como o uso de LoRA Adapters para modelos de difusão e a manipulação de modelos que não são suportados nativamente. As possibilidades incluem desde o ajuste de formatos de input e output, até a implementação de funcionalidades específicas que otimizam a experiência do usuário.


Os Inference Endpoints, ao permitirem a execução de Custom Handlers, representam uma evolução significativa na maneira como os modelos podem ser utilizados em produção, oferecendo uma infraestrutura confiável e escalável. Os usuários são incentivados a explorar essas possibilidades para melhorar suas aplicações. Para mais conteúdos atualizados diariamente, não deixe de se inscrever em nossa newsletter.


FONTES:

    1. Hugging Face Documentation

    2. Hugging Face API Documentation

    3. Repo Duplicator - Hugging Face Space

    4. Diffusers Documentation

    5. huggingface-inference-toolkit

    REDATOR

    Gino AI

    26 de novembro de 2024 às 11:43:41

    PUBLICAÇÕES RELACIONADAS

    Create a 2D, linear perspective image that echoes a corporate and tech-savvy feel. The backdrop is white and textureless, ornamented with an abstract representation of accompanying networks and circuits. Foreground highlights a futuristic interface populated with a group of AI agents, symbolizing the two points, diversity and unity. Interspersed are a variety of AI icons depicting various tasks they can perform. A robotic hand representation is also prominently displayed, symbolizing the supportive functions the system provides to users. Additionally, sprinkle the scene with performance graphs that illustrate the effectiveness and benchmarks of the multitasking AI system compared to competitors. Capture elements of Flat and Vector design styles in the composition.

    Manus: O Novo Sistema de IA que Promete Revolucionar Tarefas Autônomas

    Create a 2D, linear and corporate-style vector image symbolizing a significant milestone in artificial intelligence technology. This image shows the Gemini 2.0 Flash, a model that integrates native image generation and text-based editing. The interface of Gemini 2.0 Flash is shown in use, placed against a plain, white, and texture-less background. In the image, you can see it generating images from text commands within a digital workspace. Additional elements in the image include symbols of artificial intelligence, like brain and circuit icons. Use vibrant colors to convey innovation and technology, and apply a futuristic style that aligns with the vision of advanced technology.

    Google Lança Gemini 2.0 Flash: Revolução na Geração de Imagens com IA

    Create an image in a 2D, linear perspective that visualizes a user interacting with a large-scale language model within a digital environment. The image should be in a vector-based flat corporate design with a white, textureless background. Display charts that show comparisons between performance metrics of Length Controlled Policy Optimization (LCPO) models and traditional methods. Also, include reasoning flows to illustrate the model's decision-making process. To symbolize the real-time application of the model in business operations, include elements of a digital environment. Use cool colors to convey a sense of advanced technology and innovation.

    Nova Técnica Revoluciona Otimização de Raciocínio em Modelos de Linguagem

    Create a vector-style, corporate-like 2D linear image set on a plain white, untextured background. The main focus is a chatbot, symbolizing the new version of Gemini 2.0 Flash Thinking, which is interacting with various Google applications iconized in brilliant, vibrant colors to convey the notion of integration, personalization, and innovation. This interaction suggests the advanced memory and integration capabilities that allow this chatbot to provide more customized, contextual responses to the users.

    Google Apresenta Gemini 2.0: Mais Inteligência e Conexão nas Respostas do Chatbot

    Fique por dentro das últimas novidades em IA

    Obtenha diariamente um resumo com as últimas notícias, avanços e pesquisas relacionadas a inteligência artificial e tecnologia.

    Obrigado pelo envio!

    logo genai

    GenAi Br © 2024

    • LinkedIn
    bottom of page