Outils pour utilisateurs

Outils du site


dialogpt

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
dialogpt [2020/02/04 15:45] – [Ressources] sergedialogpt [2021/09/03 05:39] (Version actuelle) – [Préalable] serge
Ligne 1: Ligne 1:
 ====== DialoGPT ====== ====== DialoGPT ======
 <WRAP center round box 60% centeralign> <WRAP center round box 60% centeralign>
-**{{tagpage>ia|Intelligence Artificielle}}**+**{{tagpage>ia|Intelligence Artificielle}}**     **[[http://translate.google.com/translate?hl=&sl=auto&tl=en&u=https%3A%2F%2Fressources.labomedia.org%2Fdialogpt|English Version]]** 
 +</WRAP> 
 +<WRAP center round box 60% centeralign> 
 +**[[les_pages_intelligence_artificielle_en_details|Les Pages Intelligence Artificielle en détails]]**
 </WRAP> </WRAP>
  
-<WRAP center round box 60% centeralign > +<WRAP center round box 80% centeralign > 
-**Large-scale pretraining for dialogue**+**Large-scale pretraining for dialogue**\\ 
 +Encore un truc Microsoft qui ne passe pas un test de Turing en 3 questions.\\ 
 +Seul point positif, il n'est pas raciste !\\ 
 +Une carte graphique n'est pas nécessaire.
 </WRAP> </WRAP>
- 
- 
  
 ===== Ressources ===== ===== Ressources =====
Ligne 14: Ligne 18:
   * **[[https://github.com/microsoft/DialoGPT|DialoGPT]]** A State-of-the-Art Large-scale Pretrained Response Generation Model   * **[[https://github.com/microsoft/DialoGPT|DialoGPT]]** A State-of-the-Art Large-scale Pretrained Response Generation Model
  
-=====Install de Docker sur Xubuntu 18.04===== +The model is trained on 147M multi-turn dialogue from **Reddit** discussion thread. 
-Install Docker on Ubuntu Using Default Repositories + 
-  * https://phoenixnap.com/kb/how-to-install-docker-on-ubuntu-18-04+=====Installation===== 
 +====Préalable==== 
 +Il faut installer CUDA si l'argument --gpu=1 est utilisé avec interact.py ou main.py de l'irc:  
 +  * [[yolo_darknet_sur_un_portable_optimus#installation_de_cuda_100_sur_xubuntu_1804|Installation de CUDA 10.0 sur Xubuntu 18.04]] 
 + 
 +Par contre PyTorch Pretrained BERT est nécessaire: 
 +[[https://github.com/google-research/bert|Google's pre-trained models]] The Big & Extending Repository of pretrained Transformers: PyTorch version of Google AI's BERT model with script to load Google's pre-trained models. 
 +   
 +  sudo pip3 install pytorch_pretrained_bert irc 
 + 
 +===Ubuntu 20.04=== 
 +~ 900Mo 
 +  python3 -m pip install pytorch_pretrained_bert irc --user 
 +   
 +Bien sûr, installer ces packages dans un [[virtualenv|venv]] est une bien meilleure solution. 
 +====DialoGPT2-Interact==== 
 +  git clone https://github.com/microsoft/DialoGPT.git 
 +   
 +Script python supplémentaire récupéré à [[https://github.com/andreamad8/DialoGPT2-Interact|github.com/andreamad8 interact.py]] à coller dans les sources de DialoGPT 
 + 
 +La première execution de cette commande télécharge les fichiers nécessaires (2 Go) du modèle medium 
 +  python3 interact.py --model_name_or_path ./models/medium --load_checkpoint ./models/medium/medium_ft.pkl --top_k 0 
 +   
 +Ensuite, les relances suivantes ouvrent des prompts qui permettent de dialoguer avec l'IA. 
 +=====Chat Bot sur IRC===== 
 +====Sur la tour avec la carte graphique==== 
 +  * Les sources des fichiers à ajouter (uniquement les *.py) dans le dossier DialoGPT: [[https://github.com/sergeLabo/dialogpt-irc|dialogpt-irc sur github.com/sergeLabo]] 
 + 
 + 
 +Options possibles: (voir la fonction run_model()) 
 +  * --top_k 0 (--top_k 1 ne va pas du tout) 
 +  * --max_history 5 # par défaut 2 
 +  * --gpu 1 # par défaut 0 
 +  * --max_seq_length 256 # par défaut 128 
 + 
 +Test avec: 
 +  python3 main.py --model_name_or_path ./models/medium --load_checkpoint ./models/medium/medium_ft.pkl --top_k 0 --max_history 5 --gpu 1 --max_seq_length 128 
 +   
 + 
 + 
 + 
 +====Pour les clients==== 
 +  * Pour vous connecter à l'IRC, allez à https://kiwiirc.com/nextclient/ 
 +<code text> 
 +    server = "irc.libera.chat" 
 +    port = 6667 
 +    channel = "#lalabomedia" 
 +    nickname = "TheGeneral" 
 +    realname = "IA Computer at The Prisoner" 
 +</code> 
 +Comment envoyer un message au robot ? \\ 
 +Le message doit avoir cette structure: 
 +  TheGeneral: puis votre message en anglais ! 
 +   
 +  
  
  
 +{{tag> ia python sb }}
dialogpt.1580831152.txt.gz · Dernière modification : 2020/02/04 15:45 de serge