<jupyter_start><jupyter_text>Download chloe from github<jupyter_code>!git clone https://github.com/leocornelius/chloeAI<jupyter_output>fatal: destination path 'chloeAI' already exists and is not an empty directory.<jupyter_text>Copy the files into the root dirrectory<jupyter_code>!cp -r chloeAI/src/. .
!ls<jupyter_output>chloeAI     __init__.py		model.py   sample_data	telegram_bot.py
decoder.py  interactive_bot.py	omegle.py  src<jupyter_text>Pip install the needed libs<jupyter_code>!pip install -r chloeAI/requirements.txt<jupyter_output>Collecting numpy==1.16.4
  Using cached https://files.pythonhosted.org/packages/87/2d/e4656149cbadd3a8a0369fcd1a9c7d61cc7b87b3903b85389c70c989a696/numpy-1.16.4-cp36-cp36m-manylinux1_x86_64.whl
Collecting torch==1.2.0
[?25l  Downloading https://files.pythonhosted.org/packages/30/57/d5cceb0799c06733eefce80c395459f28970ebb9e896846ce96ab579a3f1/torch-1.2.0-cp36-cp36m-manylinux1_x86_64.whl (748.8MB)
[K     |████████████████████████████████| 748.9MB 23kB/s 
[?25hCollecting transformers==2.3.0
[?25l  Downloading https://files.pythonhosted.org/packages/50/10/aeefced99c8a59d828a92cc11d213e2743212d3641c87c82d61b035a7d5c/transformers-2.3.0-py3-none-any.whl (447kB)
[K     |████████████████████████████████| 450kB 38.6MB/s 
[?25hCollecting python-telegram-bot==12.3.0
[?25l  Downloading https://files.pythonhosted.org/packages/11/8f/e1ae8acee0398c041464ceb97be4f76819876df8585660ee402e92015d44/python_telegram_bot-12.3.0-py2.py3-none-any.whl (351kB)
[K     |████████████████████████████████| 358k[...]<jupyter_text>Edit the config<jupyter_code>import configparser

config = configparser.ConfigParser(allow_no_value=True)
config.read(f'chloeAI/demo_config.cfg')
config.set('chatbot', 'telegram_token', '*YOUR_TOKEN_HERE*')
config.set('chatbot', 'giphy_token', '*YOUR_TOKEN_HERE*')

with open(f'my_chatbot.cfg', 'w') as f:
    config.write(f)<jupyter_output><empty_output><jupyter_text>Check the GPU details. If you are having issues running chloe ensure this has not changed since last time  (see https://research.google.com/colaboratory/faq.html as to why it may have done)<jupyter_code>!nvidia-smi<jupyter_output>Tue Sep  8 15:36:00 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.66       Driver Version: 418.67       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Tesla T4            Off  | 00000000:00:04.0 Off |                    0 |
| N/A   56C    P8    10W /  70W |      0MiB / 15079MiB |      0%      Default |
|                               |                      |                 ERR! |
+-------------------------------+----------------------+----------------------+
                                                                               
+-------[...]<jupyter_text>Now we are going to download the model<jupyter_code>!python3 model.py --config my_chatbot.cfg<jupyter_output>2020-09-08 17:11:47.818900: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1
2020-09-08 17:11:49,976 - __main__ - INFO - Downloading model files to medium_multiref_ft...
100% 293/293 [00:00<00:00, 239371.07B/s]
100% 1042301/1042301 [00:01<00:00, 737830.32B/s]
100% 456318/456318 [00:00<00:00, 535717.18B/s]
100% 862954531/862954531 [02:09<00:00, 6663697.67B/s]<jupyter_text>Now we are going to run the bot<jupyter_code>!python interactive_bot.py --config my_chatbot.cfg<jupyter_output>2020-09-08 17:15:05.127836: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1
/content/decoder.py:118: SyntaxWarning: assertion is always true, perhaps remove parentheses?
  assert(num_samples > 1, "MMI requires num_samples > 1")
2020-09-08 17:15:07,045 - model - INFO - Downloading model files to medium_multiref_ft...
2020-09-08 17:15:07,045 - model - INFO - Loading model from medium_multiref_ft...
2020-09-08 17:15:21,634 - __main__ - INFO - Running the chatbot...
Bot >>> Just start texting me. If I'm getting annoying, type "Bye". To quit the chat type "Quit".
User >>> hey
Bot >>> Hey there!
User >>> how are you?
Bot >>> Very good, how are you?
User >>> im very well
Bot >>> I'm glad to hear that
User >>> what have you been up to today?
Bot >>> Nothing much. Just woke up
User >>> oh?
Bot >>> I've been up since 6
User >>> Traceback (most recent call last):
  File "interactive_bot.py", line 98, in <module>
    main()
  Fi[...]<jupyter_text>And finaly the telegram bot<jupyter_code>!python telegram_bot.py --config my_chatbot.cfg<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19457831325301206, 'fraction_numerical': 0.11204819277108434, 'mean_word_length': 3.020177562550444, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 66, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '186767', 'license': 'MIT', 'n_tokens_mistral': 2188, 'n_tokens_neox': 1787, 'n_words': 349, 'path': 'ChloeAI.ipynb', 'repo_name': 'leocornelius/chloeAI', 'size': '4980'}