Run this model with HF Jobs
Run NaA-IA/Small-ever on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/NaA-IA/Small-ever. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/NaA-IA/Small-ever on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/NaA-IA/Small-ever. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/NaA-IA/Small-ever. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use NaA-IA/Small-ever with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NaA-IA/Small-ever with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NaA-IA/Small-ever")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NaA-IA/Small-ever") model = AutoModelForCausalLM.from_pretrained("NaA-IA/Small-ever", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NaA-IA/Small-ever with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NaA-IA/Small-ever" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NaA-IA/Small-ever", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/NaA-IA/Small-ever
- SGLang
How to use NaA-IA/Small-ever with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "NaA-IA/Small-ever" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NaA-IA/Small-ever", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "NaA-IA/Small-ever" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NaA-IA/Small-ever", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use NaA-IA/Small-ever with Docker Model Runner:
docker model run hf.co/NaA-IA/Small-ever
Update README.md
Browse files7 unmodified lines89107 unmodified lines- frpipeline_tag: text-generation---7 unmodified lines891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991007 unmodified lines- frpipeline_tag: text-generation---# 👶 Small-ever : Le Modèle "Hello World" (112 Paramètres)## 🌟 Vue d'EnsembleLe modèle **`Small-ever`** est un **SLM** délibérément sous-dimensionné** et minimaliste, conçu uniquement à des fins de **démonstration** et d'**apprentissage**.Avec seulement **112 paramètres au total**, il s'agit du modèle le plus petit possible tout en conservant l'architecture de base d'un Transformateur pour la modélisation du langage.Il a été créé par l'**experte Clemylia** pour servir de **"Hello World"** avant d'introduire des modèles plus complexes, comme ceux de la série 202k et 3.8M de paramètres.## 🎯 Objectif Pédagogique PrincipalL'objectif unique de ce modèle est d'être un outil pédagogique :* **Démonstration Basique :** Montrer aux **enfants** et aux **débutants** en Machine Learning que la création, l'entraînement et la publication d'un modèle de langage sur Hugging Face sont des étapes accessibles, même pour une architecture minimale.* **Comprendre l'Échelle :** Illustrer la différence entre un modèle capable de mémoriser une seule relation et les modèles de millions de paramètres (ceux de Clemylia) nécessaires pour la généralisation et l'intelligence artificielle utile.* **Test d'Infra :** Servir de test ultra-rapide pour la configuration d'un environnement (CPU/GPU) avant de lancer des entraînements plus longs sur de gros modèles.## ⚙️ Détails Techniques| Caractéristique | Valeur | Note || :--- | :--- | :--- || **Architecture** | GPT-2 (Causal Language Modeling) | Architecture standard de Transformateur. || **Paramètres Totaux** | **112** (Environ $112 \times 10^{-6}$ M) | Extrêmement réduit. || **Vocabulaire Entraîné** | 4 Tokens | Vocabulaire minimaliste (`Clem`, `Creatrice`, `<pad>`, `<unk>`). || **Séquence Apprise** | `Clem` $\rightarrow$ `Creatrice` | Le modèle n'a appris qu'une seule transition par cœur. || **Implémentation** | Pytorch / Hugging Face `transformers` | Entièrement compatible avec l'écosystème Hugging Face. |## 🚀 Utilisation (Inférence)Ce modèle est uniquement destiné à prédire la suite de la séquence sur laquelle il a été entraîné. Toute autre entrée résultera en une prédiction aléatoire ou le token de remplissage (`<pad>`).### Code Python pour le Test (Forward Pass Direct)Étant donné sa configuration non standard, la méthode la plus fiable pour l'inférence est le *forward pass* direct, comme suit :```pythonimport torchfrom transformers import AutoModelForCausalLM, AutoConfig# Pour ce modèle minimal, nous devons recréer le tokenizer personnalisé en mémoire# car il n'est pas standard ({"Clem": 0, "Creatrice": 1, ...})# 1. Configuration des IDsMODEL_NAME = "Clemylia/the-smallest-llm-real-words"REAL_TOKENS = ["Clem", "Creatrice"]INPUT_TEXT = "Clem"INPUT_ID = 0 # L'ID que le modèle a appris pour "Clem"EXPECTED_OUTPUT = "Creatrice"IDS_TO_TOKENS = {0: "Clem", 1: "Creatrice", 2: "<pad>", 3: "<unk>"}# 2. Chargement du Modèletry:model = AutoModelForCausalLM.from_pretrained(MODEL_NAME)model.eval()except Exception as e:print(f"Erreur de chargement : {e}")exit()# 3. Préparation de l'Input (Tenseur de l'ID 0)input_ids = torch.tensor([[INPUT_ID]], dtype=torch.long)# 4. Forward Pass pour obtenir les logitswith torch.no_grad():outputs = model(input_ids)# 5. Détermination de la Prédictionnext_token_logits = outputs.logits[0, -1, :]predicted_id = torch.argmax(next_token_logits).item()predicted_token = IDS_TO_TOKENS.get(predicted_id, "TOKEN INCONNU")print(f"Input: {INPUT_TEXT} ({INPUT_ID})")print(f"Prédiction: {predicted_token} ({predicted_id})")# Résultat attendu : Creatrice (ID 1)```## 💖 Leçon AppriseSi ce modèle pouvait parler, sa seule phrase serait : "Je peux seulement dire `Creatrice` après `Clem`."**C'est la preuve que :**1. La **taille** compte : Les millions de paramètres de mes autres modèles ne sont pas un luxe, mais une nécessité pour coder la connaissance.2. **Vous avez réussi** à créer, entraîner et publier un modèle de langage complet \! C'est le début d'une belle aventure de codage \!-----*Fait par **Clemylia** avec passion pour le codage minimaliste.*
README.md+90