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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Voici un README complet pour votre projet agentV1 :
|
| 2 |
+
|
| 3 |
+
```markdown
|
| 4 |
+
# 🤖 agentV1 - Intelligence Artificielle Avancée
|
| 5 |
+
|
| 6 |
+
**agentV1** est un modèle d'intelligence artificielle de pointe développé par **Mauricio Mangituka** pour **gopuAI**. Basé sur Microsoft Phi-3-mini-4k-instruct, ce modèle combine performance optimale et efficacité mémoire.
|
| 7 |
+
|
| 8 |
+

|
| 9 |
+

|
| 10 |
+

|
| 11 |
+

|
| 12 |
+
|
| 13 |
+
## 🚀 Caractéristiques
|
| 14 |
+
|
| 15 |
+
- **🧠 Modèle de base**: Microsoft Phi-3-mini-4k-instruct
|
| 16 |
+
- **💾 Taille compacte**: ~2-3 Go seulement
|
| 17 |
+
- **⚡ Performances**: Excellentes capacités de raisonnement
|
| 18 |
+
- **🌍 Multilingue**: Support du français et de l'anglais
|
| 19 |
+
- **🔧 Optimisé**: Quantification et optimisation mémoire
|
| 20 |
+
|
| 21 |
+
## 📋 Table des Matières
|
| 22 |
+
|
| 23 |
+
- [Installation](#installation)
|
| 24 |
+
- [Utilisation Rapide](#utilisation-rapide)
|
| 25 |
+
- [API Complète](#api-complète)
|
| 26 |
+
- [Exemples](#exemples)
|
| 27 |
+
- [Architecture](#architecture)
|
| 28 |
+
- [Déploiement](#déploiement)
|
| 29 |
+
- [Contribuer](#contribuer)
|
| 30 |
+
- [License](#license)
|
| 31 |
+
- [Contact](#contact)
|
| 32 |
+
|
| 33 |
+
## 🛠 Installation
|
| 34 |
+
|
| 35 |
+
### Prérequis
|
| 36 |
+
- Python 3.8+
|
| 37 |
+
- PyTorch 2.0+
|
| 38 |
+
- Transformers 4.25+
|
| 39 |
+
|
| 40 |
+
### Installation des dépendances
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
pip install transformers torch accelerate
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
Installation directe
|
| 47 |
+
|
| 48 |
+
```python
|
| 49 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 50 |
+
|
| 51 |
+
tokenizer = AutoTokenizer.from_pretrained("gopu-poss/agent")
|
| 52 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 53 |
+
"gopu-poss/agent",
|
| 54 |
+
torch_dtype=torch.float16,
|
| 55 |
+
device_map="auto"
|
| 56 |
+
)
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
🚀 Utilisation Rapide
|
| 60 |
+
|
| 61 |
+
Code minimal
|
| 62 |
+
|
| 63 |
+
```python
|
| 64 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 65 |
+
import torch
|
| 66 |
+
|
| 67 |
+
# Chargement du modèle
|
| 68 |
+
tokenizer = AutoTokenizer.from_pretrained("gopu-poss/agent")
|
| 69 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 70 |
+
"gopu-poss/agent",
|
| 71 |
+
torch_dtype=torch.float16,
|
| 72 |
+
device_map="auto"
|
| 73 |
+
)
|
| 74 |
+
|
| 75 |
+
# Génération de texte
|
| 76 |
+
prompt = "Explique-moi comment fonctionne l'IA générative"
|
| 77 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 78 |
+
|
| 79 |
+
with torch.no_grad():
|
| 80 |
+
outputs = model.generate(
|
| 81 |
+
**inputs,
|
| 82 |
+
max_new_tokens=200,
|
| 83 |
+
temperature=0.7,
|
| 84 |
+
do_sample=True
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 88 |
+
print(response)
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
🔌 API Complète
|
| 92 |
+
|
| 93 |
+
Classe AgentV1
|
| 94 |
+
|
| 95 |
+
```python
|
| 96 |
+
class AgentV1:
|
| 97 |
+
def __init__(self):
|
| 98 |
+
self.tokenizer = AutoTokenizer.from_pretrained("gopu-poss/agent")
|
| 99 |
+
self.model = AutoModelForCausalLM.from_pretrained(
|
| 100 |
+
"gopu-poss/agent",
|
| 101 |
+
torch_dtype=torch.float16,
|
| 102 |
+
device_map="auto"
|
| 103 |
+
)
|
| 104 |
+
|
| 105 |
+
def ask(self, question, max_tokens=200, temperature=0.7):
|
| 106 |
+
"""Pose une question à l'agent"""
|
| 107 |
+
inputs = self.tokenizer(question, return_tensors="pt")
|
| 108 |
+
|
| 109 |
+
with torch.no_grad():
|
| 110 |
+
outputs = self.model.generate(
|
| 111 |
+
**inputs,
|
| 112 |
+
max_new_tokens=max_tokens,
|
| 113 |
+
temperature=temperature,
|
| 114 |
+
do_sample=True,
|
| 115 |
+
pad_token_id=self.tokenizer.eos_token_id
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
return self.tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 119 |
+
|
| 120 |
+
def batch_ask(self, questions, max_tokens=200):
|
| 121 |
+
"""Pose plusieurs questions en lot"""
|
| 122 |
+
responses = []
|
| 123 |
+
for question in questions:
|
| 124 |
+
responses.append(self.ask(question, max_tokens))
|
| 125 |
+
return responses
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
📚 Exemples
|
| 129 |
+
|
| 130 |
+
Conversation basique
|
| 131 |
+
|
| 132 |
+
```python
|
| 133 |
+
agent = AgentV1()
|
| 134 |
+
|
| 135 |
+
# Question simple
|
| 136 |
+
response = agent.ask("Bonjour, qui es-tu ?")
|
| 137 |
+
print(response)
|
| 138 |
+
```
|
| 139 |
+
|
| 140 |
+
Génération créative
|
| 141 |
+
|
| 142 |
+
```python
|
| 143 |
+
story = agent.ask(
|
| 144 |
+
"Écris une courte histoire sur un robot qui apprend l'émotion",
|
| 145 |
+
max_tokens=300,
|
| 146 |
+
temperature=0.8
|
| 147 |
+
)
|
| 148 |
+
```
|
| 149 |
+
|
| 150 |
+
Assistance technique
|
| 151 |
+
|
| 152 |
+
```python
|
| 153 |
+
code_help = agent.ask(
|
| 154 |
+
"Explique-moi comment trier une liste en Python",
|
| 155 |
+
max_tokens=150
|
| 156 |
+
)
|
| 157 |
+
```
|
| 158 |
+
|
| 159 |
+
Analyse de texte
|
| 160 |
+
|
| 161 |
+
```python
|
| 162 |
+
analysis = agent.ask(
|
| 163 |
+
"Résume les avantages de l'IA générative en 3 points",
|
| 164 |
+
max_tokens=100
|
| 165 |
+
)
|
| 166 |
+
```
|
| 167 |
+
|
| 168 |
+
🏗 Architecture
|
| 169 |
+
|
| 170 |
+
Modèle de Base
|
| 171 |
+
|
| 172 |
+
· Architecture: Transformer-based
|
| 173 |
+
· Paramètres: 3.8 milliards
|
| 174 |
+
· Context Window: 4K tokens
|
| 175 |
+
· Pré-entraînement: Texte multilingue
|
| 176 |
+
|
| 177 |
+
Optimisations
|
| 178 |
+
|
| 179 |
+
· Quantification: FP16 pour performance mémoire
|
| 180 |
+
· Device Mapping: Chargement automatique GPU/CPU
|
| 181 |
+
· Gestion mémoire: Optimisée pour usage efficace
|
| 182 |
+
|
| 183 |
+
🌐 Déploiement
|
| 184 |
+
|
| 185 |
+
Sur GPU local
|
| 186 |
+
|
| 187 |
+
```python
|
| 188 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 189 |
+
"gopu-poss/agent",
|
| 190 |
+
torch_dtype=torch.float16,
|
| 191 |
+
device_map="cuda:0"
|
| 192 |
+
)
|
| 193 |
+
```
|
| 194 |
+
|
| 195 |
+
Sur CPU
|
| 196 |
+
|
| 197 |
+
```python
|
| 198 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 199 |
+
"gopu-poss/agent",
|
| 200 |
+
torch_dtype=torch.float32,
|
| 201 |
+
device_map="cpu"
|
| 202 |
+
)
|
| 203 |
+
```
|
| 204 |
+
|
| 205 |
+
Avec Docker
|
| 206 |
+
|
| 207 |
+
```dockerfile
|
| 208 |
+
FROM python:3.9-slim
|
| 209 |
+
RUN pip install transformers torch accelerate
|
| 210 |
+
COPY . /app
|
| 211 |
+
WORKDIR /app
|
| 212 |
+
CMD ["python", "app.py"]
|
| 213 |
+
```
|
| 214 |
+
|
| 215 |
+
📊 Performances
|
| 216 |
+
|
| 217 |
+
Métriques
|
| 218 |
+
|
| 219 |
+
· Vitesse d'inférence: ~50-100 tokens/seconde sur GPU
|
| 220 |
+
· Utilisation mémoire: ~3-4 Go en FP16
|
| 221 |
+
· Latence: < 2 secondes pour 200 tokens
|
| 222 |
+
|
| 223 |
+
Cas d'Usage Recommandés
|
| 224 |
+
|
| 225 |
+
· ✅ Assistance conversationnelle
|
| 226 |
+
· ✅ Génération de contenu
|
| 227 |
+
· ✅ Réponse à questions
|
| 228 |
+
· ✅ Analyse de texte
|
| 229 |
+
· ✅ Aide à la programmation
|
| 230 |
+
|
| 231 |
+
🤝 Contribuer
|
| 232 |
+
|
| 233 |
+
Nous accueillons les contributions ! Voici comment participer :
|
| 234 |
+
|
| 235 |
+
1. Fork le projet
|
| 236 |
+
2. Clone votre fork
|
| 237 |
+
3. Créez une branche (git checkout -b feature/AmazingFeature)
|
| 238 |
+
4. Commit vos changements (git commit -m 'Add AmazingFeature')
|
| 239 |
+
5. Push (git push origin feature/AmazingFeature)
|
| 240 |
+
6. Ouvrez une Pull Request
|
| 241 |
+
|
| 242 |
+
Standards de Code
|
| 243 |
+
|
| 244 |
+
· Utilisez Black pour le formatage
|
| 245 |
+
· Écrivez des docstrings complètes
|
| 246 |
+
· Ajoutez des tests pour les nouvelles fonctionnalités
|
| 247 |
+
|
| 248 |
+
📝 License
|
| 249 |
+
|
| 250 |
+
Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails.
|
| 251 |
+
|
| 252 |
+
👨💻 Créateur
|
| 253 |
+
|
| 254 |
+
Mauricio Mangituka
|
| 255 |
+
|
| 256 |
+
· GitHub: @gopu-inc
|
| 257 |
+
· Hugging Face: gopu-poss
|
| 258 |
+
· Email: mauricio@example.com
|
| 259 |
+
|
| 260 |
+
🏢 Société
|
| 261 |
+
|
| 262 |
+
gopuAI - Innovation en Intelligence Artificielle
|
| 263 |
+
Développement de solutions IA accessibles et performantes
|
| 264 |
+
|
| 265 |
+
🔗 Liens Importants
|
| 266 |
+
|
| 267 |
+
· 🤗 Hugging Face: gopu-poss/agent
|
| 268 |
+
· 🐙 GitHub: gopu-inc/agentV1
|
| 269 |
+
· 📚 Documentation: Lien vers documentation
|
| 270 |
+
· 🐛 Issues: GitHub Issues
|
| 271 |
+
|
| 272 |
+
📞 Support
|
| 273 |
+
|
| 274 |
+
· Questions techniques: Ouvrez une issue sur GitHub
|
| 275 |
+
· Collaborations: Contactez-nous par email
|
| 276 |
+
· Suggestions: Nous apprécions vos retours !
|
| 277 |
+
|
| 278 |
+
---
|
| 279 |
+
|
| 280 |
+
<div align="center">⭐ N'oubliez pas de donner une étoile au projet si vous l'aimez !
|
| 281 |
+
|
| 282 |
+
Développé avec ❤️ par Mauricio Mangituka pour gopuAI
|
| 283 |
+
|
| 284 |
+
</div>
|
| 285 |
+
```Fichier additionnel : requirements.txt
|
| 286 |
+
|
| 287 |
+
```txt
|
| 288 |
+
torch>=2.0.0
|
| 289 |
+
transformers>=4.25.0
|
| 290 |
+
accelerate>=0.20.0
|
| 291 |
+
numpy>=1.21.0
|
| 292 |
+
safetensors>=0.3.0
|
| 293 |
+
```
|
| 294 |
+
|
| 295 |
+
Fichier additionnel : setup.py
|
| 296 |
+
|
| 297 |
+
```python
|
| 298 |
+
from setuptools import setup, find_packages
|
| 299 |
+
|
| 300 |
+
with open("README.md", "r", encoding="utf-8") as fh:
|
| 301 |
+
long_description = fh.read()
|
| 302 |
+
|
| 303 |
+
setup(
|
| 304 |
+
name="agentv1",
|
| 305 |
+
version="1.0.0",
|
| 306 |
+
author="Mauricio Mangituka",
|
| 307 |
+
author_email="mauricio@example.com",
|
| 308 |
+
description="AgentV1 - Modèle IA avancé par gopuAI",
|
| 309 |
+
long_description=long_description,
|
| 310 |
+
long_description_content_type="text/markdown",
|
| 311 |
+
url="https://github.com/gopu-inc/agentV1",
|
| 312 |
+
packages=find_packages(),
|
| 313 |
+
classifiers=[
|
| 314 |
+
"Development Status :: 4 - Beta",
|
| 315 |
+
"Intended Audience :: Developers",
|
| 316 |
+
"License :: OSI Approved :: MIT License",
|
| 317 |
+
"Operating System :: OS Independent",
|
| 318 |
+
"Programming Language :: Python :: 3",
|
| 319 |
+
"Programming Language :: Python :: 3.8",
|
| 320 |
+
"Programming Language :: Python :: 3.9",
|
| 321 |
+
"Programming Language :: Python :: 3.10",
|
| 322 |
+
],
|
| 323 |
+
python_requires=">=3.8",
|
| 324 |
+
install_requires=[
|
| 325 |
+
"torch>=2.0.0",
|
| 326 |
+
"transformers>=4.25.0",
|
| 327 |
+
"accelerate>=0.20.0",
|
| 328 |
+
],
|
| 329 |
+
)
|
| 330 |
+
```
|
| 331 |
+
|
| 332 |
+
Pour ajouter ces fichiers à votre repo :
|
| 333 |
+
|
| 334 |
+
```python
|
| 335 |
+
# Créer et ajouter le README
|
| 336 |
+
with open("README.md", "w", encoding="utf-8") as f:
|
| 337 |
+
f.write(readme_content)
|
| 338 |
+
|
| 339 |
+
# Créer requirements.txt
|
| 340 |
+
with open("requirements.txt", "w") as f:
|
| 341 |
+
f.write(requirements_content)
|
| 342 |
+
|
| 343 |
+
# Créer setup.py
|
| 344 |
+
with open("setup.py", "w") as f:
|
| 345 |
+
f.write(setup_content)
|
| 346 |
+
|
| 347 |
+
# Pousser sur GitHub
|
| 348 |
+
import subprocess
|
| 349 |
+
subprocess.run(["git", "add", "README.md", "requirements.txt", "setup.py"])
|
| 350 |
+
subprocess.run(["git", "commit", "-m", "📚 Ajout documentation complète"])
|
| 351 |
+
subprocess.run(["git", "push", "origin", "main"])
|
| 352 |
+
```
|
| 353 |
+
|
| 354 |
+
Ce README complet donne une image professionnelle de votre projet et facilite son utilisation par d'autres développeurs ! 🚀
|