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:53] – [Install de Docker sur Xubuntu 18.04] 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 =====
  
   * **[[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
 +
 +The model is trained on 147M multi-turn dialogue from **Reddit** discussion thread.
  
 =====Installation===== =====Installation=====
-====Installation de Conda==== +====Préalable==== 
-  cd DialoGPT  +Il faut installer CUDA si l'argument --gpu=1 est utilisé avec interact.py ou main.py de l'irc:  
-  conda env create -f LSP-linux.yml -n LSP+  * [[yolo_darknet_sur_un_portable_optimus#installation_de_cuda_100_sur_xubuntu_1804|Installation de CUDA 10.0 sur Xubuntu 18.04]]
  
-====Install de Docker sur Xubuntu 18.04==== +Par contre PyTorch Pretrained BERT est nécessaire: 
-Install Docker on Ubuntu Using Default Repositories +[[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.
-  * https://phoenixnap.com/kb/how-to-install-docker-on-ubuntu-18-04 +
-  sudo apt-get remove docker docker-engine docker.io +
-  sudo apt install docker.io+
      
-====NVIDIA Container Toolkit==== +  sudo pip3 install pytorch_pretrained_bert irc
-  * https://github.com/NVIDIA/nvidia-docker+
  
-====Erreur de dépendance avec libcurl==== +===Ubuntu 20.04=== 
-  * https://askubuntu.com/questions/1029273/curl-is-not-working-on-ubuntu-18-04-lts +~ 900Mo 
-  apt remove -y libcurl4 +  python3 -m pip install pytorch_pretrained_bert irc --user
-  apt install -y libcurl4 curl+
      
-====Erreur de GPG==== +Bien sûr, installer ces packages dans un [[virtualenv|venv]] est une bien meilleure solution. 
-W: Erreur de GPG : https://nvidia.github.io/libnvidia-container/ubuntu18.04/amd64  InRelease : Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY 6ED91CA3AC1160CD +====DialoGPT2-Interact==== 
-  https://github.com/NVIDIA/nvidia-docker/issues/1081 +  git clone https://github.com/microsoft/DialoGPT.git
-  curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -+
      
 +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.1580831587.txt.gz · Dernière modification : 2020/02/04 15:53 de serge