Token Classification
Transformers
Safetensors
Abkhaz
gpt_neox
text-generation
code
text-generation-inference
Instructions to use Mauricio-100/agent-ai with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Mauricio-100/agent-ai with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="Mauricio-100/agent-ai")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Mauricio-100/agent-ai") model = AutoModelForCausalLM.from_pretrained("Mauricio-100/agent-ai", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update config.json
Browse files- config.json +49 -8
config.json
CHANGED
|
@@ -1,9 +1,50 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
}
|
|
|
|
| 1 |
+
# config.py
|
| 2 |
+
"""
|
| 3 |
+
Configuration pour Agent-AI
|
| 4 |
+
Contient tous les paramètres du modèle et de l'entraînement
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
# ------------------------------
|
| 8 |
+
# Paramètres du modèle
|
| 9 |
+
# ------------------------------
|
| 10 |
+
model_config = {
|
| 11 |
+
"vocab_size": 5000, # Taille du vocabulaire
|
| 12 |
+
"n_embd": 128, # Dimension des embeddings
|
| 13 |
+
"n_layer": 6, # Nombre de couches Transformer
|
| 14 |
+
"n_head": 8, # Nombre de têtes d'attention
|
| 15 |
+
"block_size": 128, # Longueur maximale du texte
|
| 16 |
+
"dropout": 0.1, # Dropout pour régularisation
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
# Calcul approximatif du nombre de paramètres
|
| 20 |
+
# params ≈ n_layer * (n_embd*n_embd*4 + n_embd*n_embd*3) + n_embd*vocab_size
|
| 21 |
+
total_params_estimate = 2_100_000 # ~2 millions
|
| 22 |
+
|
| 23 |
+
# ------------------------------
|
| 24 |
+
# Paramètres d'entraînement
|
| 25 |
+
# ------------------------------
|
| 26 |
+
train_config = {
|
| 27 |
+
"batch_size": 16,
|
| 28 |
+
"learning_rate": 3e-4,
|
| 29 |
+
"epochs": 500,
|
| 30 |
+
"grad_clip": 1.0,
|
| 31 |
+
"device": "cuda" # ou "cpu"
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
# ------------------------------
|
| 35 |
+
# Paramètres de génération
|
| 36 |
+
# ------------------------------
|
| 37 |
+
generate_config = {
|
| 38 |
+
"max_length": 300, # Nombre de tokens à générer
|
| 39 |
+
"temperature": 0.8, # Créativité du modèle
|
| 40 |
+
"top_k": 50, # Échantillonnage top-k
|
| 41 |
+
"top_p": 0.95, # Échantillonnage nucleus
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
# ------------------------------
|
| 45 |
+
# Chemins de sauvegarde
|
| 46 |
+
# ------------------------------
|
| 47 |
+
paths = {
|
| 48 |
+
"model_save": "saved_model/agent_ai.pt",
|
| 49 |
+
"tokenizer_save": "saved_model/tokenizer.json",
|
| 50 |
}
|