Zum Inhalt springen

Mistral Common Updates & Release Notes

Einträge
32
Quellen
1
Zuletzt aktualisiert
Kategorie
KI-Modelle

Folge Mistral Common, um die Release Notes in deinen Feed zu holen.

Mistral Common von Mistral

Mistral Common 1.8.2: ThinkChunk hinzugefügt

Version 1.8.2 erlaubt es, TextChunk und ThinkChunk in SystemMessage und AssistantMessage zu verwenden.

What's Changed

Now you can use TextChunk and ThinkChunk in your SystemMessage or AssistantMessage:

from mistral_common.protocol.instruct.messages import SystemMessage, TextChunk, ThinkChunk

system_message = SystemMessage(
    content = [
        TextChunk(text="First draft your thinking process (inner monologue) until you arrive at a response. Format your response using Markdown, and use LaTeX for any mathematical equations. Write both your thoughts and the response in the same language as the input.\n\nYour thinking process must follow the template below:"),
        ThinkChunk(
            thinking="Your thoughts or/and draft, like working through an exercise on scratch paper. Be as casual and as long as you want until you are confident to generate the response. Use the same language as the input.",
            closed=True,
        ),
        TextChunk(text="Here, provide a self-contained response.")
    ],
)

Full Changelog: https://github.com/mistralai/mistral-common/compare/v1.8.1...v1.8.2

Originalquelle(öffnet in neuem Tab)Problem melden

Mistral Common von Mistral

Mistral Common 1.8.1: AudioURLChunk hinzugefügt

Mit AudioURLChunk in Version 1.8.1 lassen sich http(s)-URLs, Dateipfade und Base64-Strings ohne Formatangabe in Content-Chunks verwenden.

What's Changed

Now you can use http(s) URLs, file paths and base64 string (without specifying format) in your content chunks thanks to AudioURLChunk !


from mistral_common.protocol.instruct.messages import AudioURL, AudioURLChunk, TextChunk, UserMessage
from mistral_common.protocol.instruct.request import ChatCompletionRequest
from mistral_common.tokens.tokenizers.mistral import MistralTokenizer

repo_id = "mistralai/Voxtral-Mini-3B-2507"
tokenizer = MistralTokenizer.from_hf_hub(repo_id)

text_chunk = TextChunk(
    text="Wat do you think about this audio?"
)
user_msg = UserMessage(
    content=[
        AudioURLChunk(audio_url=AudioURL(url="https://freewavesamples.com/files/Ouch-6.wav")),
        text_chunk,
    ]
)

request = ChatCompletionRequest(messages=[user_msg])
tokenized = tokenizer.encode_chat_completion(request)

# pass tokenized.tokens to your favorite audio model
print(tokenized.tokens)
print(tokenized.audios)

# print text to visually see tokens
print(tokenized.text)

Full Changelog: https://github.com/mistralai/mistral-common/compare/v1.8.0...v1.8.1

Originalquelle(öffnet in neuem Tab)Problem melden

Mistral Common von Mistral

Mistral Common 1.8.0: Audio-Unterstützung

Version 1.8.0 fügt Audio-Unterstützung hinzu, sodass AudioChunk-Inhalte in Chat-Anfragen tokenisiert werden können, wie im Beispiel mit voxtral-mini.

What's Changed

Full Changelog: https://github.com/mistralai/mistral-common/compare/v1.7.0...v1.8.0

Audio chat example:

from mistral_common.protocol.instruct.messages import TextChunk, AudioChunk, UserMessage, AssistantMessage, RawAudio
from mistral_common.protocol.instruct.request import ChatCompletionRequest
from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
from mistral_common.audio import Audio
from huggingface_hub import hf_hub_download

repo_id = "mistralai/voxtral-mini"
tokenizer = MistralTokenizer.from_hf_hub(repo_id)

obama_file = hf_hub_download("patrickvonplaten/audio_samples", "obama.mp3", repo_type="dataset")
bcn_file = hf_hub_download("patrickvonplaten/audio_samples", "bcn_weather.mp3", repo_type="dataset")

def file_to_chunk(file: str) -> AudioChunk:
    audio = Audio.from_file(file, strict=False)
    return AudioChunk.from_audio(audio)

text_chunk = TextChunk(text="Which speaker do you prefer between the two? Why? How are they different from each other?")
user_msg = UserMessage(content=[file_to_chunk(obama_file), file_to_chunk(bcn_file), text_chunk]).to_openai()


request = ChatCompletionRequest(messages=[user_msg])
tokenized = tokenizer.encode_chat_completion(request)

# pass tokenized.tokens to your favorite audio model
print(tokenized.tokens)
print(tokenized.audios) …

Originalquelle(öffnet in neuem Tab)Problem melden

Mistral Common von Mistral

Mistral Common 1.7.0: v13-Tokenizer und Umbenennung

Version 1.7.0 fügt den v13-Tokenizer hinzu und benennt multi-modal in image um.

What's Changed

Full Changelog: https://github.com/mistralai/mistral-common/compare/v1.6.3...v1.7.0

Originalquelle(öffnet in neuem Tab)Problem melden

Mistral Common von Mistral

Mistral Common 1.6.3: Besseres from_hf_hub, Multiprocessing

Version 1.6.3 verbessert die Hugging-Face-Hub-Integration, behebt einen Pickle-Fehler bei Multiprocessing mit dem Tokenizer, verbessert decode, markiert to_string als veraltet und korrigiert mehrere Fehlermeldungen.

What's Changed

New Contributors

Originalquelle(öffnet in neuem Tab)Problem melden

Mistral Common von Mistral

Mistral Common 1.6.0: v11-Tokenizer, neue Doku, from_hf_hub

Version 1.6.0 bringt den v11-Instruct-Tokenizer, überarbeitete Dokumentation, die Methode from_hf_hub, Unterstützung für file://-URIs und das OpenAI-Format für Chat Completions.

What's Changed

New Contributors

Full Changelog: https://github.com/mistralai/mistral-common/compare/v1.5.6...v1.6.0

Originalquelle(öffnet in neuem Tab)Problem melden

Mistral Common von Mistral

Mistral Common Version 1.5.6

Version 1.5.6 erlaubt es bei Tokenizern ab v7, Inhalt und Tool Calls gemeinsam zu definieren.

What's Changed

Full Changelog: https://github.com/mistralai/mistral-common/compare/v1.5.5...v1.5.6

Originalquelle(öffnet in neuem Tab)Problem melden

Mistral Common von Mistral

Mistral Common Version 1.5.5

Version 1.5.5 markiert Runtime Special Tokens für den Tekkenizer als veraltet und ändert die Standard-Special-Token-Policy von Tekken.

What's Changed

New Contributors

Full Changelog: https://github.com/mistralai/mistral-common/compare/v1.5.4...v1.5.5

Originalquelle(öffnet in neuem Tab)Problem melden

Mistral Common von Mistral

Mistral Common 1.5.0: Tokenizer v7 mit neuem System Prompt

Der neue Tokenizer v7 behandelt den System Prompt als normale Nachricht zwischen [SYSTEM_PROMPT]-Tokens und führt ein neues [TOOL_CONTENT]-Token ein, das das Function Calling verbessern soll.

Mistral's newest tokenizer has two major improvements:

System prompt

Similar to other tokenization schemes the system prompt is now treated as a "normal" message encapsulated by [SYSTEM_PROMPT] ...[\SYSTEM_PROMPT]

E.g.

from mistral_common.protocol.instruct.messages import (
    UserMessage,
    SystemMessage,
    AssistantMessage,
)
from mistral_common.protocol.instruct.request import ChatCompletionRequest
from mistral_common.tokens.tokenizers.mistral import MistralTokenizer

# Load Mistral tokenizer
tokenizer = MistralTokenizer.v7()

# Tokenize a list of messages
tokenized = tokenizer.encode_chat_completion(
    ChatCompletionRequest(
        messages=[
            SystemMessage(content="You are a funny AI assistant. Always make jokes."),
            UserMessage(content="What's the weather like today in Paris"),
        ],
        model="joker",
    )
)
tokens, text = tokenized.tokens, tokenized.text

print(text)
# <s>[SYSTEM_PROMPT]▁You▁are▁a▁funny▁AI▁assistant.▁Always▁make▁jokes.[/SYSTEM_PROMPT][INST]▁What's▁the▁weather▁like▁today▁in▁Paris[/INST]

Improve function calling

A new [TOOL_CONTENT] is added if trained with correctly should improve the accuracy of function calling.

from mistral_common.protocol.instruct.messages import (
    UserMessage,
    SystemMessage,
    AssistantMessage,
    ToolMessage
)
from mistral_common.protocol.instruct.request import ChatCompletionRequest …

Originalquelle(öffnet in neuem Tab)Problem melden