QuantFactory / SmolLM-135M-GGUF

huggingface.co
Total runs: 9.6K
24-hour runs: 0
7-day runs: 5.5K
30-day runs: 5.5K
Model's Last Updated: July 26 2024

Introduction of SmolLM-135M-GGUF

Model Details of SmolLM-135M-GGUF

QuantFactory/SmolLM-135M-GGUF

This is quantized version of HuggingFaceTB/SmolLM-135M created using llama.cpp

Original Model Card

SmolLM

SmolLM
Table of Contents
  1. Model Summary
  2. Limitations
  3. Training
  4. License
  5. Citation
Model Summary

SmolLM is a series of state-of-the-art small language models available in three sizes: 135M, 360M, and 1.7B parameters. These models are built on Cosmo-Corpus, a meticulously curated high-quality training dataset. Cosmo-Corpus includes Cosmopedia v2 (28B tokens of synthetic textbooks and stories generated by Mixtral), Python-Edu (4B tokens of educational Python samples from The Stack), and FineWeb-Edu (220B tokens of deduplicated educational web samples from FineWeb). SmolLM models have shown promising results when compared to other models in their size categories across various benchmarks testing common sense reasoning and world knowledge. For detailed information on training, benchmarks and performance, please refer to our full blog post .

This is the SmolLM-135M

Generation
pip install transformers
Running the model on CPU/GPU/multi GPU
  • Using full precision
# pip install transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "HuggingFaceTB/SmolLM-135M"
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)
inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))
>>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
Memory footprint: 12624.81 MB
  • Using torch.bfloat16
# pip install accelerate
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
checkpoint = "HuggingFaceTB/SmolLM-135M"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
# for fp16 use `torch_dtype=torch.float16` instead
model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto", torch_dtype=torch.bfloat16)
inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to("cuda")
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))
>>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
Memory footprint: 269.03 MB
Quantized Versions through bitsandbytes
  • Using 8-bit precision (int8)
# pip install bitsandbytes accelerate
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
# to use 4bit use `load_in_4bit=True` instead
quantization_config = BitsAndBytesConfig(load_in_8bit=True)
checkpoint = "HuggingFaceTB/SmolLM-135M"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint, quantization_config=quantization_config)
inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to("cuda")
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))
>>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
# load_in_8bit
Memory footprint: 162.87 MB
# load_in_4bit
>>> print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
Memory footprint: 109.78 MB

Limitations

While SmolLM models have been trained on a diverse dataset including educational content and synthetic texts, they have limitations. The models primarily understand and generate content in English. They can produce text on a variety of topics, but the generated content may not always be factually accurate, logically consistent, or free from biases present in the training data. These models should be used as assistive tools rather than definitive sources of information. Users should always verify important information and critically evaluate any generated content. For a more comprehensive discussion of the models' capabilities and limitations, please refer to our full blog post ..

This repository contains a converted version of our latest trained model. We've noticed a small performance difference between this converted checkpoint (transformers) and the original (nanotron). We're currently working to resolve this issue.

Training

Model
  • Architecture: For architecture detail, see the blog post .
  • Pretraining steps: 600k
  • Pretraining tokens: 600B
  • Precision: bfloat16
Hardware
  • GPUs: 64 H100
Software

License

Apache 2.0

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},
}

Runs of QuantFactory SmolLM-135M-GGUF on huggingface.co

9.6K
Total runs
0
24-hour runs
0
3-day runs
5.5K
7-day runs
5.5K
30-day runs

More Information About SmolLM-135M-GGUF huggingface.co Model

More SmolLM-135M-GGUF license Visit here:

https://choosealicense.com/licenses/apache-2.0

SmolLM-135M-GGUF huggingface.co

SmolLM-135M-GGUF huggingface.co is an AI model on huggingface.co that provides SmolLM-135M-GGUF's model effect (), which can be used instantly with this QuantFactory SmolLM-135M-GGUF model. huggingface.co supports a free trial of the SmolLM-135M-GGUF model, and also provides paid use of the SmolLM-135M-GGUF. Support call SmolLM-135M-GGUF model through api, including Node.js, Python, http.

QuantFactory SmolLM-135M-GGUF online free

SmolLM-135M-GGUF huggingface.co is an online trial and call api platform, which integrates SmolLM-135M-GGUF's modeling effects, including api services, and provides a free online trial of SmolLM-135M-GGUF, you can try SmolLM-135M-GGUF online for free by clicking the link below.

QuantFactory SmolLM-135M-GGUF online free url in huggingface.co:

https://huggingface.co/QuantFactory/SmolLM-135M-GGUF

SmolLM-135M-GGUF install

SmolLM-135M-GGUF is an open source model from GitHub that offers a free installation service, and any user can find SmolLM-135M-GGUF on GitHub to install. At the same time, huggingface.co provides the effect of SmolLM-135M-GGUF install, users can directly use SmolLM-135M-GGUF installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

SmolLM-135M-GGUF install url in huggingface.co:

https://huggingface.co/QuantFactory/SmolLM-135M-GGUF

Url of SmolLM-135M-GGUF

SmolLM-135M-GGUF huggingface.co Url

Provider of SmolLM-135M-GGUF huggingface.co

QuantFactory
ORGANIZATIONS

Other API from QuantFactory