Skip to content

Conversation

@kashif
Copy link
Contributor

@kashif kashif commented Nov 20, 2025

Use the optimized version as proposed in huggingface/transformers#42248

Before:

swift run transformers-cli "Explain machine learning in simple terms:" \
    ../../Examples/Mistral7B/StatefulMistral7BInstructInt4.mlpackage \
    --max-length 50 --do-sample false --temperature 0.7 --top-k 40 \
    --min-p 0.1

Generating
 Explain machine learning in simple terms:

Machine learning is a type of artificial intelligence (AI) that allows computers to learn and improve from experience without being explicitly programmed. It works by using algorithms to analyze data, learn patterns, and make predictions or decisions based on that data.
22.98 tokens/s, prompt pre-filling time: 2.07s, total time: 4.20s

After:

swift run transformers-cli "Explain machine learning in simple terms:" \
    ../../Examples/Mistral7B/StatefulMistral7BInstructInt4.mlpackage \
    --max-length 50 --do-sample false --temperature 0.7 --top-k 40 \
    --min-p 0.1

Generating
 Explain machine learning in simple terms:

Machine learning is a type of artificial intelligence (AI) that allows computers to learn and improve from experience without being explicitly programmed. It works by using algorithms to analyze data, learn patterns, and make predictions or decisions based on that data.
34.38 tokens/s, prompt pre-filling time: 1.91s, total time: 3.34s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant