/ Модель

Характеристики

Контекст
2 048 токенов
Параметры
134 млн
Лицензия
Apache 2.0
Архитектура
llama · dense
Базовая модель
SmolLM-135M-Instruct
Библиотека
transformers
Опубликована
16 сен 2024

SmolLM-135M-Instruct

Генерация текстаТекст → текст3 профессии

Производная модели unsloth/SmolLM-360M. Компактная англоязычная инструкционная модель для коротких диалогов, ответов на стандартные запросы и простых задач генерации текста и кода.

321скачиваний за 30 дней3лайкавеса обновлены21 сен 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Карточка модели unsloth/SmolLM-135M-Instruct на Hugging Face совпадает с карточкой unsloth/SmolLM-360M, поэтому описание составлено по ней.

SmolLM-360M-Instruct — компактная языковая модель, дообученная Unsloth на базе HuggingFaceTB/SmolLM-360M. Она использует плотную авторегрессионную архитектуру семейства Llama, содержит 361,8 млн параметров и принимает текстовые запросы, генерируя текст. Модель рассчитана на короткие диалоги и стандартные запросы на английском языке; также подходит для творческого письма и простых примеров на Python. Контекст составляет 2048 токенов.

Версия v0.2 обучалась на наборах простых повседневных диалогов, Magpie-Pro, инструкциях по программированию и подмножестве OpenHermes-2.5. По карточке, она лучше удерживает тему и отвечает на обычные запросы, чем v0.1. Модель может ошибаться в фактах и логике, воспроизводить предвзятости данных, а также испытывать трудности с арифметикой, редактированием и сложными рассуждениями. Лицензия — Apache-2.0.

Сценарии применения

  • ответы на простые вопросы и приветствия
  • короткие диалоги с англоязычным AI-ассистентом
  • творческое письмо на английском языке
  • создание простых примеров кода на Python

Ограничения

Модель может выдавать фактические и логические ошибки и воспроизводить предвзятости обучающих данных; она слабо справляется с арифметикой, редактированием и сложными рассуждениями. Поддерживается английский язык.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Finetune Llama 3.1, Gemma 2, Mistral 2-5x faster with 70% less memory via Unsloth!

We have a free Google Colab Tesla T4 notebook for Llama 3.1 (8B) here - also works for SmolLM!: https://colab.research.google.com/drive/1Ys44kVvmeZtnICzWz0xgpRnrIOjZAuxp?usp=sharing

✨ Finetune for Free

All notebooks are beginner friendly! Add your dataset, click "Run All", and you'll get a 2x faster finetuned model which can be exported to GGUF, vLLM or uploaded to Hugging Face.

Unsloth supportsFree NotebooksPerformanceMemory use
Llama-3.1 8b▶️ Start on Colab2.4x faster58% less
Phi-3.5 (mini)▶️ Start on Colab2x faster50% less
Gemma-2 9b▶️ Start on Colab2.4x faster58% less
Mistral 7b▶️ Start on Colab2.2x faster62% less
TinyLlama▶️ Start on Colab3.9x faster74% less
DPO - Zephyr▶️ Start on Colab1.9x faster19% less

SmolLM-1.7B-Instruct

Model Summary

SmolLM is a series of small language models available in three sizes: 135M, 360M, and 1.7B parameters.

These models are pre-trained on SmolLM-Corpus, a curated collection of high-quality educational and synthetic data designed for training LLMs. For further details, we refer to our blogpost.

To build SmolLM-Instruct, we finetuned the base models on publicly available datasets.

Changelog

ReleaseDescription
v0.1Initial release of SmolLM-Instruct. We finetune on the permissive subset of the WebInstructSub dataset, combined with StarCoder2-Self-OSS-Instruct. Then, we perform DPO (Direct Preference Optimization) for one epoch on HelpSteer for the 135M and 1.7B models, and argilla/dpo-mix-7k for the 360M model.
v0.2We changed the finetuning mix to datasets more suitable for smol models. We train on a new dataset of 2k simple everyday conversations we generated by llama3.1-70B everyday-conversations-llama3.1-2k, Magpie-Pro-300K-Filtered, StarCoder2-Self-OSS-Instruct, and a small subset of OpenHermes-2.5

v0.2 models are better at staying on topic and responding appropriately to standard prompts, such as greetings and questions about their role as AI assistants. SmolLM-360M-Instruct (v0.2) has a 63.3% win rate over SmolLM-360M-Instruct (v0.1) on AlpacaEval. You can find the details here.

You can load v0.1 checkpoint by specifying revision="v0.1" in the transformers code:

model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM-1.7B-Instruct", revision="v0.1")

Usage

Local Applications

⚡ For local applications, you can find optimized implementations of the model in MLC, GGUF and Transformers.js formats, in addition to fast in-browser demos in this collection: https://huggingface.co/collections/HuggingFaceTB/local-smollms-66c0f3b2a15b4eed7fb198d0

We noticed that 4bit quantization degrades the quality of the 135M and 360M, so we use q016 for MLC and ONNX/Transformers.js checkpoints for the WebGPU demos. We also suggest using temperature 0.2 and top-p 0.9.

Transformers

pip install transformers
# pip install transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "HuggingFaceTB/SmolLM-1.7B-Instruct"

device = "cuda" # for GPU usage or "cpu" for CPU usage
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
# for multiple GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")`
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)

messages = [{"role": "user", "content": "What is the capital of France."}]
input_text=tokenizer.apply_chat_template(messages, tokenize=False)
print(input_text)
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
outputs = model.generate(inputs, max_new_tokens=50, temperature=0.2, top_p=0.9, do_sample=True)
print(tokenizer.decode(outputs[0]))

Chat in TRL

You can also use the TRL CLI to chat with the model from the terminal:

pip install trl
trl chat --model_name_or_path HuggingFaceTB/SmolLM-1.7B-Instruct --device cpu

Limitations

Additionally, the generated content may not always be factually accurate, logically consistent, or free from biases present in the training data, we invite users to leverage them as assistive tools rather than definitive sources of information. We find that they can handle general knowledge questions, creative writing and basic Python programming. But they are English only and may have difficulty with arithmetics, editing tasks and complex reasoning. For more details about the models' capabilities, please refer to our blog post.

Training parameters

We train the models using the alignment-handbook with the datasets mentioned in the changelog, using these parameters v0.2 (most of them are from Zephyr Gemma recipe):

  • 1 epoch
  • lr 1e-3
  • cosine schedule
  • warmup ratio 0.1
  • global batch size 262k tokens

You can find the training recipe here: https://github.com/huggingface/alignment-handbook/tree/smollm/recipes/smollm

Citation

@misc{allal2024SmolLM,
      title={SmolLM - blazingly fast and remarkably powerful}, 
      author={Loubna Ben Allal and Anton Lozhkov and Elie Bakouch and Leandro von Werra and Thomas Wolf},
      year={2024},
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
705a1f6

0 моделей