7.0
热点
AI SCORE
开源项目2024-11-24 23:44
完整的LLM训练评估工具包
Hacker News · github.com#LLM#训练#工具
Editor brief · 编辑速览
开源项目提供LLM从训练到评估的完整解决方案。对做LLM微调和优化的工程师直接可用。
欢迎来到 Smol Models,这是 Hugging Face 提供的高效轻量级人工智能模型系列。我们的使命是创建功能强大且紧凑的完全开放模型,涵盖文本和视觉领域,可以有效地在设备上运行,同时保持强大的性能。
我们的 3B 模型在保持竞争力的同时击败了 Llama 3.2 3B 和 Qwen2.5 3B,与更大的 4B 替代品(Qwen3 和 Gemma3)相竞争。除了性能指标外,我们还分享了使用公开数据集和训练框架构建它的确切方式。
在 11T token 上训练的 3B 模型,在 3B 规模上达到最先进水平,与 4B 模型相竞争
完全开放的模型,开放权重 + 完整的训练细节,包括公开数据混合和训练配置
支持思考/不思考模式的双模式推理指令模型
6 种语言的多语言支持:英文、法文、西班牙文、德文、意大利文和葡萄牙文
利用 NoPE 和 YaRN 支持高达 128k 的长上下文
SmolVLM 是我们的紧凑多模态模型,可以:
处理图像和文本,执行视觉问答、图像描述和视觉叙述等任务
在单个对话中处理多个图像
有效地在设备上运行
smollm/
├── text/ # SmolLM3/2/1 related code and resources
├── vision/ # SmolVLM related code and resources
└── tools/ # Shared utilities and inference tools
├── smol_tools/ # Lightweight AI-powered tools
├── smollm_local_inference/
└── smolvlm_local_inference/
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "HuggingFaceTB/SmolLM3-3B"
device = "cuda" # for GPU usage or "cpu" for CPU usage
# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
).to(device)
# prepare the model input
prompt = "Give me a brief explanation of gravity in simple terms."
messages_think = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages_think,
tokenize=False,
add_generation_prompt=True,
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# Generate the output
generated_ids = model.generate(**model_inputs, max_new_tokens=32768)
# Get and decode the output
output_ids = generated_ids[0][len(model_inputs.input_ids[0]) :]
print(tokenizer.decode(output_ids, skip_special_tokens=True))
from transformers import AutoProcessor, AutoModelForVision2Seq
processor = AutoProcessor.from_pretrained("HuggingFaceTB/SmolVLM-Instruct")
model = AutoModelForVision2Seq.from_pretrained("HuggingFaceTB/SmolVLM-Instruct")
messages = [
{
"role": "user",
"content": [
{"type": "image"},
{"type": "text", "text": "What's in this image?"}
]
}
]
SmolLM3 文档
SmolVLM 文档
本地推理指南
SmolLM3 模型集合
SmolLM2 模型集合
SmolLM3 预训练数据集
SmolTalk - 我们的指令调优数据集
FineMath - 数学预训练数据集
FineWeb-Edu - 教育内容预训练数据集