Downloads · 30 days
9
0% of all-time downloads
universitytehran/SmolLM-135M-10M-word
SmolLM-135M-10M-word is a machine learning model from universitytehran. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
A 123M SmolLm model Pre-trained on 10M words for babyLM challenge. You can test the model:
Downloads · 30 days
9
0% of all-time downloads
All-time downloads
33.1K
Public
Parameters
125M
994 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors499 MB · 100%
From the Hugging Face model README
A 123M SmolLm model Pre-trained on 10M words for babyLM challenge. You can test the model:
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
def load_model(model_name):
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
return tokenizer, model
def generate_text(prompt, tokenizer, model, max_length=100):
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
output = model.generate(**inputs, max_length=max_length, num_return_sequences=1)
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
return generated_text
model_name = "universitytehran/SmolLM-135M-10M-word"
tokenizer, model = load_model(model_name)
prompt = "Once upon a time"
completed_text = generate_text(prompt, tokenizer, model)
print(f"Prompt: {prompt}")
print(f"Completed text: {completed_text}")