{"id":27273319,"url":"https://github.com/sophiadt/reigenbot","last_synced_at":"2026-05-05T21:33:12.806Z","repository":{"id":182501356,"uuid":"581739909","full_name":"sophiadt/reigenbot","owner":"sophiadt","description":"A discord bot with AI that can simulate a conversation as Reigen Arataka from Mob Psycho 100","archived":false,"fork":false,"pushed_at":"2023-01-08T05:05:26.000Z","size":260,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-07-20T08:38:21.262Z","etag":null,"topics":["ai","chatbot","discord","discord-api","discord-bot","google-colab","python"],"latest_commit_sha":null,"homepage":"https://huggingface.co/sophiadt/DialoGPT-medium-reigen?text=Hi+Reigen%21","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sophiadt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-12-24T06:21:18.000Z","updated_at":"2023-07-20T08:38:26.857Z","dependencies_parsed_at":"2023-07-20T08:57:19.568Z","dependency_job_id":null,"html_url":"https://github.com/sophiadt/reigenbot","commit_stats":null,"previous_names":["sophiadt/reigenbot"],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sophiadt%2Freigenbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sophiadt%2Freigenbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sophiadt%2Freigenbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sophiadt%2Freigenbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sophiadt","download_url":"https://codeload.github.com/sophiadt/reigenbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248418701,"owners_count":21100193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chatbot","discord","discord-api","discord-bot","google-colab","python"],"created_at":"2025-04-11T14:25:41.389Z","updated_at":"2026-05-05T21:33:07.785Z","avatar_url":"https://github.com/sophiadt.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reigen Arataka AI Chat Bot\n\nAn AI discord bot that can simulate a conversation with the greatest psychic of the 21st century, Reigen Arataka from [Mob Psycho 100](https://en.wikipedia.org/wiki/Mob_Psycho_100)!\n\nCredits to Lynn Zheng and her [Discord AI Chatbot tutorial](https://www.freecodecamp.org/news/discord-ai-chatbot/) as well as Rostyslav Neskorozhenyi and his [post about making a Rick Sanchez bot](https://towardsdatascience.com/make-your-own-rick-sanchez-bot-with-transformers-and-dialogpt-fine-tuning-f85e6d1f4e30) for helping me build this.\n\nThe chatbot uses the [Microsoft DialoGPT conversational model](https://huggingface.co/microsoft/DialoGPT-medium) that has been trained with [transcripts of season 1, 2, and the OVA from this Kaggle dataset](https://www.kaggle.com/datasets/faebots/mp100-episodes). The dataset has almost 1000 lines from Reigen and I trained it for 12 epochs to give a perplexity of 1.6988. The perplexity represents how confused the model is so the higher the perplexity, the more confused the model is. With this amount of data, the model took around 40 minutes to train.\n\n## Problems I Encountered\nI had trouble reading the CSV file in Python as it wasn't properly formatted so I used the txt file to parse the script into a CSV file that would work. I encountered the error `'utf-8' codec can't decode byte 0xff in position 0: invalid start byte` but I managed to solve it through [this Kaggle post](https://www.kaggle.com/code/paultimothymooney/how-to-resolve-a-unicodedecodeerror-for-a-csv-file).\n\nEven though Reigen only has almost 1000 lines, he talks a lot per line which is too much for my GPU to handle so I run out of memory. That's why I decreased `self.per_gpu_train_batch_size` from 4 to 3 in order to train the model.\n\n1.6988 is a very low perplexity but I'm guessing that I have trained the model for too many epochs, given it's small number of lines. The model is so in character that it mainly repeats direct lines from the transcript. It also sometimes says lines from other characters.\n\nIf you want to try out my chatbot, you can go [here](https://huggingface.co/sophiadt/DialoGPT-medium-reigen?text=Hi+Reigen%21) where it's hosted on Hugging Face's Model Hub.\n\n## Project Files\n\n* `model_train_upload_workflow.ipynb`: Notebook to be run in Google Colab to train and upload the model to Hugging Face's Model Hub\n* `mp100.txt`: Text file used to gather data\n* `parse_script.ipynb`: Notebook to be run in Google Colab in order to turn the text file script into a workable CSV file\n* `main.py`: Script to be imported into a Repl.it Python Discord.py project\n* `stay_alive.py`: Script to keep the discord bot alive for half an hour after main.py is run\n\n## Resource Links\n* [Lynn Zheng's tutorial on freeCodeCamp](https://www.freecodecamp.org/news/discord-ai-chatbot/)\n* [Lynn Zheng's video tutorial on YouTube](https://youtu.be/UBwvFuTC1ZE)\n* [Mob Psycho 100 transcript dataset on Kaggle](https://www.kaggle.com/datasets/faebots/mp100-episodes)\n* [My Hugging Face Model](https://huggingface.co/sophiadt/DialoGPT-medium-reigen)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsophiadt%2Freigenbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsophiadt%2Freigenbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsophiadt%2Freigenbot/lists"}