Instructions to use nazimboudeffa/PicoGPT1-Daisy with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nazimboudeffa/PicoGPT1-Daisy with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nazimboudeffa/PicoGPT1-Daisy") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nazimboudeffa/PicoGPT1-Daisy") model = AutoModelForCausalLM.from_pretrained("nazimboudeffa/PicoGPT1-Daisy", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use nazimboudeffa/PicoGPT1-Daisy with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf nazimboudeffa/PicoGPT1-Daisy # Run inference directly in the terminal: llama cli -hf nazimboudeffa/PicoGPT1-Daisy
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf nazimboudeffa/PicoGPT1-Daisy # Run inference directly in the terminal: llama cli -hf nazimboudeffa/PicoGPT1-Daisy
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf nazimboudeffa/PicoGPT1-Daisy # Run inference directly in the terminal: ./build/bin/llama cli -hf nazimboudeffa/PicoGPT1-Daisy
Use Docker
docker model run hf.co/nazimboudeffa/PicoGPT1-Daisy
- Llama new
- LM Studio
- Jan
- vLLM
How to use nazimboudeffa/PicoGPT1-Daisy with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nazimboudeffa/PicoGPT1-Daisy" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nazimboudeffa/PicoGPT1-Daisy", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nazimboudeffa/PicoGPT1-Daisy
- SGLang
How to use nazimboudeffa/PicoGPT1-Daisy 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 "nazimboudeffa/PicoGPT1-Daisy" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nazimboudeffa/PicoGPT1-Daisy", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "nazimboudeffa/PicoGPT1-Daisy" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nazimboudeffa/PicoGPT1-Daisy", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use nazimboudeffa/PicoGPT1-Daisy with Ollama:
ollama run hf.co/nazimboudeffa/PicoGPT1-Daisy
- Unsloth Desktop
- Docker Model Runner
How to use nazimboudeffa/PicoGPT1-Daisy with Docker Model Runner:
docker model run hf.co/nazimboudeffa/PicoGPT1-Daisy
- Lemonade
How to use nazimboudeffa/PicoGPT1-Daisy with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull nazimboudeffa/PicoGPT1-Daisy
Run and chat with the model
lemonade run user.PicoGPT1-Daisy-{{QUANT_TAG}}List all available models
lemonade list
- Atomic Chat
PicoGPT1-Daisy
GPT-2 pré-entraîné ajusté sur 2 000 instructions/réponses Alpaca filtrées, 245 exemples d'ancrage et 197 questions/réponses directes issus d'une base fermée de 30 faits (2 442 exemples au total).
- Architecture : GPT-2 complet, 12 couches, 768 dimensions, 12 têtes d'attention (124 M paramètres)
- Contexte : 1 024 positions dans le modèle, exemples tronqués à 256 tokens
- Tokenizer : GPT-2 (50 257 tokens)
- Format appris :
prompt\nreponse<|endoftext|> - Fichiers : poids Transformers (
model.safetensors) et variantePicoGPT1-Daisy.gguf
Modèle expérimental : les réponses en génération libre peuvent être approximatives. Pour des faits vérifiés, utilisez l'ancrage décrit ci-dessous (scripts Python uniquement).
Différences avec PicoGPT1-Jasmine
L'ancien dépôt nazimboudeffa/PicoGPT1-Jasmine est conservé tel quel comme référence historique. Celui-ci est une nouvelle version, avec un modèle plus grand issu d'un fine-tuning de GPT-2.
| Élément | PicoGPT1-Jasmine (ancien) |
PicoGPT1-Daisy (ce dépôt) |
|---|---|---|
| Architecture | GPT-2 : 2 couches, 128 dims, 2 têtes, contexte 256 | GPT-2 complet : 12 couches, 768 dims, 12 têtes (124 M paramètres) |
| Jeu d'entraînement | 500 exemples Alpaca bruts | 2 000 Alpaca filtrés + 245 ancrages + 197 Q/R directes = 2 442 exemples |
| Données | Quelques erreurs factuelles et doublons | Erreurs connues retirées (eau à 115 °C, fausse définition du « mole », <nooutput>), doublons supprimés, format uniformisé |
| Décodage | Glouton par défaut, boucles fréquentes | Échantillonnage par défaut (top_k=40, no_repeat_ngram_size=3, repetition_penalty=1.15), arrêt à l'EOS ou au premier \n, séparateur \n garanti |
| Ancrage / abstention | Aucun | knowledge.jsonl (30 faits), TF-IDF, vérification d'ancrage, Je ne sais pas. hors base |
| Entraînement | 10 epochs depuis zéro, ~1 250 steps, loss finale ≈ 4,95 | 5 epochs de fine-tuning (2 442 exemples) |
| GGUF | Ancien export | Régénéré depuis les nouveaux poids |
En résumé : modèle plus grand issu de GPT-2 pré-entraîné, données nettoyées, décodage corrigé et ancrage anti-hallucination côté Python. Le passage à GPT-2 pré-entraîné améliore la cohérence des réponses en génération libre, y compris dans le GGUF. Le code source et la documentation détaillée sont dans https://github.com/nazimboudeffa/picogpt-kit.
Utiliser avec llama.app / llama.cpp
Le CLI fourni par llama.app télécharge le GGUF depuis ce dépôt :
llama cli -hf nazimboudeffa/PicoGPT1-Daisy -hff PicoGPT1-Daisy.gguf
Pour ouvrir l'interface web de chat :
llama serve -hf nazimboudeffa/PicoGPT1-Daisy -hff PicoGPT1-Daisy.gguf
# puis http://localhost:9931
Utiliser avec Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "nazimboudeffa/PicoGPT1-Daisy"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
prompt = "Quelle est la capitale de la France ?\n"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=48, do_sample=True, temperature=0.8)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Ancrage (RAG)
Le dépôt fournit un pipeline d'ancrage côté Python : rag.py récupère un fait dans knowledge.jsonl avec un TF-IDF (char_wb 3-5) sur text + question, construit le prompt Contexte: <texte> | Question: <question>\n, génère en beam search déterministe (num_beams=5) puis vérifie is_supported(). Si le score est inférieur à 0,50 ou si la réponse n'est pas extraite du contexte, le modèle répond Je ne sais pas.
python test.py --prompt "Quelle est la capitale de la France ?" --ragpython evaluate.py(nécessitescikit-learn)- Le GGUF ne contient ni la base de faits ni le TF-IDF : l'ancrage fonctionne uniquement via les scripts Python.
Métriques actuelles (python evaluate.py) :
| Mesure | Résultat |
|---|---|
| Questions dans la base | 30 |
| Réponses exactes | 30/30 |
| Réponses ancrées | 30/30 |
| Abstentions à tort | 0/30 |
| Retrieval correct | 30/30 |
| Questions hors base | 10 |
| Abstentions correctes | 10/10 |
Interprétation : avec les 197 réponses directes ajoutées à l'entraînement, le modèle donne la bonne réponse aux 30 questions de la base, et chaque réponse reste un extrait du contexte récupéré. Les abstentions hors base fonctionnent toujours. Ce résultat ne couvre que les formulations proches de la base fermée. Détails dans doc/12-rag.md.
- Downloads last month
- 123