Como acessar o Mistral Small 3.1?


Alguns dias atrás, o Google Deepmind apresentou Gemma 3, E eu ainda estava explorando suas capacidades. Mas agora, há um grande desenvolvimento: chegou o pequeno 3.1 da Mistral IA, alegando ser o melhor modelo em sua classe de peso! Essa Marvel leve, rápida e altamente personalizável opera sem esforço em um único RTX 4090 ou um MAC com 32 GB de RAM, tornando-o perfeito para aplicações no dispositivo. Neste artigo, divulgarei os detalhes do Mistral Small 3.1 e fornecerei exemplos práticos para mostrar seu potencial.

O que é Mistral Small 3.1?

O Mistral Small 3.1 é um modelo de IA de ponta de ponta, lançado sob a licença Apache 2.0 pela Mistral AI. Projetado para eficiência, ele suporta entradas multimodais (texto e imagens) e se destaca em tarefas multilíngues com precisão excepcional. Com uma janela de contexto de 128 mil token, ela é criada para aplicativos de contexto de longa information, tornando-a uma das principais opções para a IA de conversação em tempo actual, fluxos de trabalho automatizados e ajustes finos específicos de domínio.

Principais recursos

  • Implantação eficiente: Executa em {hardware} de nível de consumo como RTX 4090 ou MAC com 32 GB de RAM.
  • Capacidades multimodais: Processa entradas de texto e imagem para aplicativos versáteis.
  • Suporte multilíngue: Oferece alto desempenho em vários idiomas.
  • Contexto estendido: Lida com até 128 mil tokens para tarefas complexas e de longo prazo.
  • Resposta rápida: Otimizado para IA conversacional em tempo actual e baixa latência.
  • Execução da função: Ativa a função rápida e precisa, pedindo automação.
  • Personalização: Facilmente ajustado para domínios especializados como saúde ou IA authorized.

Mistral Small 3,1 vs Gemma 3 vs Gpt 4o Mini vs Claude 3.5

Texto Instruto Benchmarks

A imagem compara cinco modelos de IA em seis benchmarks. Mistral Small 3.1 (24b) alcançou o melhor desempenho em quatro benchmarks: GPQA Important, GPQA Diamond, MMLU e Humaneval. A Gemma 3-IT (27b) lidera os benchmarks SimpleQA e Math.

Referência de Instrução Multimodal

Esta imagem compara os modelos de IA em sete benchmarks. Mistral Small 3.1 (24b) Leads nos benchmarks MMMU-Professional, MM-MT-Bench, ChartQA e AI2D. O Gemma 3-IT (27b) tem o melhor desempenho em Mathvista, MMMU e Docvqa Benchmarks.

Multilíngue

Esta imagem mostra o desempenho do modelo de IA em quatro categorias culturais: média, européia, asiática do leste e Oriente Médio. Mistral Small 3.1 (24b) lidera nas categorias médias, européias e do leste asiático, enquanto Gemma 3-IT (27b) é melhor na categoria do Oriente Médio.

Longo contexto

Esta imagem compara quatro modelos de IA em três benchmarks. O Mistral Small 3.1 (24b) alcança o maior desempenho nos benchmarks Longbench V2 e do governante 32K, enquanto Claude-3.5 Haiku obtém mais altos na referência do governante 128K.

Desempenho pré -terenciado

Esta imagem compara dois modelos de IA: Mistral Small 3.1 Base (24b) e Gemma 3-PT (27b), em cinco benchmarks. Mistral tem um desempenho melhor no MMLU, MMLU Professional, GPQA e MMMU. Gemma alcança o melhor resultado na referência Triviaqa.

Como obter API Mistral Small 3.1?

Etapa 1: Procure a IA Mistral no seu navegador

Como acessar o Mistral Small 3.1?

Etapa 2: Abra o web site da IA ​​Mistral e clique em Attempt API

API MISTRAL

Etapa 3: clique nas teclas da API e gerar a chave

Chaves da API

Through la placforme (API da AI Mistral)

  • Inscreva -se no console.mistral.ai.
  • Ative os pagamentos para ativar as teclas da API (a API da Mistral requer esta etapa).
  • Use o terminal da API com um identificador de modelo como Mistral-Muml-Newest ou Mistral-small-2501 (verifique a documentação de Mistral para obter o nome exato após o lançamento).

Cliente Python:

import requests
api_key = "your_api_key"
headers = {"Authorization": f"Bearer {api_key}", "Content material-Sort": "utility/json"}
information = {"mannequin": "mistral-small-latest", "messages": ({"function": "person", "content material": "Take a look at"})}
response = requests.publish("https://api.mistral.ai/v1/chat/completions", json=information, headers=headers)
print(response.json())

Vamos tentar Mistral Small 3.1

Exemplo 1: geração de texto

!pip set up mistralai
import os
from mistralai import Mistral
from getpass import getpass
MISTRAL_KEY = getpass('Enter Mistral AI API Key: ')
import os
os.environ('MISTRAL_API_KEY') = MISTRAL_KEY
mannequin = "mistral-small-2503"
shopper = Mistral(api_key=MISTRAL_KEY)
chat_response = shopper.chat.full(
    mannequin= mannequin,Picsum ID: 237
    messages = (
        {
            "function": "person",
            "content material": "What's the greatest French cheese?",
        },
    )
)
print(chat_response.decisions(0).message.content material)

Saída

Selecting the "greatest" French cheese could be extremely subjective, because it will depend on private style preferences. France is famend for its numerous and high-quality cheeses, with over 400 varieties. Listed here are a couple of extremely regarded ones:

1. **Camembert de Normandie**: A smooth, creamy cheese with a wealthy, buttery taste. It is usually thought-about one of many best examples of French cheese.

2. **Brie de Meaux**: One other smooth cheese, Brie de Meaux is understood for its creamy texture and earthy taste. It is usually served at room temperature to reinforce its aroma and style.

3. **Roquefort**: It is a sturdy, blue-veined cheese constructed from sheep's milk. It has a particular, tangy taste and is commonly crumbled over salads or served with fruits and nuts.

4. **Comté**: A tough, cow's milk cheese from the Jura area, Comté has a posh, nutty taste that varies relying on the age of the cheese.

5. **Munster-Gérardmer**: A powerful, pungent cheese from the Alsace area, Munster-Gérardmer is commonly washed in brine, giving it a particular orange rind and strong taste.

6. **Chèvre (Goat Cheese)**: There are numerous types of goat cheese in France, starting from smooth and creamy to agency and crumbly. Some in style sorts embody Sainte-Maure de Touraine and Crottin de Chavignol.

Every of those cheeses gives a singular style expertise, so the "greatest" one finally will depend on your private desire.

Exemplo 2: Usando Mistral Small 2503 para descrição da imagem

import base64

def describe_image(image_path: str, immediate: str = "Describe this picture intimately."):
    # Encode picture to base64
    with open(image_path, "rb") as image_file:
        base64_image = base64.b64encode(image_file.learn()).decode("utf-8")

    # Create message with picture and textual content
    messages = ({
        "function": "person",
        "content material": (
            {"kind": "textual content", "textual content": immediate},
            {
                "kind": "image_url",
                "image_url": {
                    "url": f"information:picture/jpeg;base64,{base64_image}"  # Modify MIME kind if wanted
                }
            }
        )
    })

    # Get response
    chat_response = shopper.chat.full(
        mannequin=mannequin,
        messages=messages
    )

    return chat_response.decisions(0).message.content material

# Utilization Instance
image_description = describe_image("/content material/image_xnt9HBr.png")
print(image_description)

Imagem de entrada

imagem de entrada

Saída

The picture illustrates a course of involving the Gemini mannequin, which seems to be a sort of AI or machine studying system. Here's a detailed breakdown of the picture:

1. **Enter Part**:
- There are three distinct inputs offered to the Gemini system:
- The phrase "Cat" written in English.
- The character "猫" which is the Chinese language character for "cat."
- The phrase "कुत्ता" which is the Hindi phrase for "canine."

2. **Processing Unit**:
- The inputs are directed in the direction of a central processing unit labeled "Gemini." This means that the Gemini system is processing the inputs in some method, possible for evaluation, translation, or some type of recognition.

3. **Output Part**:
- On the correct facet of the Gemini unit, there are three units of coloured dots:
- The primary set consists of blue dots.
- The second set consists of a mixture of blue and lightweight blue dots.
- The third set consists of yellow and orange dots.
- These coloured dots possible signify some type of encoded information, embeddings, or characteristic representations generated by the Gemini system based mostly on the enter information.

**Abstract**:
The picture depicts an AI system named Gemini that takes in textual inputs in several languages (English, Chinese language, and Hindi) and processes these inputs to provide some type of encoded output, represented by coloured dots. This means that Gemini is able to dealing with multilingual inputs and producing corresponding information representations, which may very well be used for varied purposes akin to language translation, semantic evaluation, or machine studying duties.

Exemplo 3: Descrição da imagem

image_description = describe_image("/content material/yosemite.png")
print(image_description)

Imagem de entrada

Imagem de entrada

Saída

The picture depicts a serene and picturesque pure panorama, possible in a nationwide park. The scene is dominated by towering granite cliffs and rock formations, which rise dramatically into a transparent blue sky with a couple of scattered clouds. The cliffs are rugged and steep, showcasing the pure great thing about the realm.

Within the foreground, there's a calm river or stream flowing gently over a rocky mattress. The water displays the encircling panorama, including to the tranquility of the scene. The riverbank is lined with inexperienced vegetation, together with grasses and small crops, which add a contact of vibrant shade to the scene.

The background encompasses a dense forest of tall evergreen bushes, primarily conifers, which give a lush inexperienced distinction to the grey and brown tones of the rock formations. The bushes are scattered throughout the panorama, extending up the slopes of the cliffs, indicating a wholesome and thriving ecosystem.

General, the picture captures the majestic and peaceable great thing about a pure panorama, possible in a well known park akin to Yosemite Nationwide Park, recognized for its iconic granite cliffs and scenic valleys.

Exemplo 4: Descrição da imagem

image_description = describe_image("/content material/237-200x300.jpg")
print(image_description)

Imagem de entrada

Imagem de entrada

Saída

The picture encompasses a black canine mendacity down on a picket floor. The canine has a brief, shiny black coat and is wanting instantly on the digicam with a peaceful and attentive expression. Its ears are perked up, and its eyes are broad open, giving it a curious and alert look. The picket floor beneath the canine has a country, textured look, with seen grain patterns and a heat, pure shade. The general setting seems to be indoors, and the lighting is smooth, highlighting the canine's options and the feel of the wooden.

Como acessar o Mistral Small 3.1 usando o rosto abraçando?

Through rosto abraçando

  • Visite o web site Hugging Face e pesquise “Mistral Small 3.1” ou verifique a página da organização AI Mistral (por exemplo, Mistralai/Mistral-Small-3.1).
  • Faça o obtain dos arquivos do modelo (provavelmente incluindo pesos e configurações de tokenizer).
  • Use uma estrutura compatível como abraçar transformadores de rosto ou biblioteca oficial de inferência da Mistral:

Instale as bibliotecas necessárias:

pip set up transformers torch (add mistral-inference if utilizing their official library)

Carregue o modelo em Python:

from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "mistralai/Mistral-Small-3.1"  # Modify based mostly on actual title
tokenizer = AutoTokenizer.from_pretrained(model_name)
mannequin = AutoModelForCausalLM.from_pretrained(model_name)

Confira este hyperlink para obter mais informações: Mistral pequeno

Conclusão

O Mistral Small 3.1 se destaca como um modelo de IA poderoso, eficiente e versátil, oferecendo desempenho de primeira linha em sua classe. Com sua capacidade de lidar com entradas multimodais, tarefas multilíngues e aplicativos de longo contexto, ele fornece uma alternativa atraente para concorrentes como Gemma 3 e GPT-4O Mini.

Sua implantação leve em {hardware} de nível de consumo, combinado com as opções de resposta e personalização em tempo actual, a torna uma excelente opção para aplicativos orientados a IA. Seja para IA conversacional, automação ou ajuste fino específico do domínio, o Mistral Small 3.1 é um forte candidato na IA.

Olá, sou Nitika, criador de conteúdo e profissional de conteúdo experiente em tecnologia. Criatividade e aprender coisas novas são naturalmente para mim. Tenho experiência na criação de estratégias de conteúdo orientadas por resultados. Sou bem versado em gerenciamento de search engine optimization, operações de palavras -chave, redação de conteúdo da Net, comunicação, estratégia de conteúdo, edição e redação.

Faça login para continuar lendo e desfrutar de conteúdo com curado especialista.

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *