https://github.com/cakecrusher/mimicbot

Mimicbot enables the effortless yet modular creation of an AI chat bot model that imitates another person's manner of speech.

https://github.com/cakecrusher/mimicbot

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.0%) to scientific vocabulary

Keywords

ai bot data-science discord discord-bot huggingface natural-language-processing pypi python python-package
Last synced: 6 months ago · JSON representation

Repository

Mimicbot enables the effortless yet modular creation of an AI chat bot model that imitates another person's manner of speech.

Basic Info
  • Host: GitHub
  • Owner: CakeCrusher
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 297 KB
Statistics
  • Stars: 11
  • Watchers: 2
  • Forks: 6
  • Open Issues: 4
  • Releases: 0
Topics
ai bot data-science discord discord-bot huggingface natural-language-processing pypi python python-package
Created over 3 years ago · Last pushed 9 months ago
Metadata Files
Readme License

README.md

mimicbot 🤖

https://user-images.githubusercontent.com/37946988/190918228-a46ba035-c8d1-4fd5-9893-ad87451b22b7.mp4

About

Mimicbot enables the effortless yet modular creation of an AI chat bot model that imitates another person's manner of speech. For example, if mimicbot were based on Shakespeare, mimicbot will adjust its responses to elizabethan english. It offers a a general pipeline for creating a mimicbot from scratch provided data on the user to mimic, and another pipeline that runs entirely on Discord without the need for external data. The pipeline consists multiple other commands that are also available for modular use.

New

You can now create a mimicbot independent of the discord platform.

Important Commands

Type python -m mimicbot_cli --help to see a list of commands. Similarly you can use python -m mimicbot_cli <A_MIMICBOT_COMMAND> --help to see details on a specific command.

Quickstart

Verify the following prerequisites are met

  • Python 3.x (verify with python --version or python3 --version or py --version)
  • git-lfs (verify with git lfs --version)
  • pip (verify with pip --version)

Note

If you run into any issues, you dont know how to deal with. Utilize the mimicbot Dockerfile to spin up a functional environment.

Steps

  1. Run pip install mimicbot-cli.
  2. Run the command python -m mimicbot_cli forge. This command will guide you through the creation of the bot from start to finish.
  3. Opt to build a Discord bot.
  4. Once the mimicbot is activated on discord, you can interact with it by simply sending it a message as you would to the person it is imitating, with a @<NAME_OF_MIMICBOT> mention somewhere in the text. The mimicbot will then reply with a message similar to how the original user would have said it.

Contribute

  1. Clone the repository git clone https://github.com/CakeCrusher/mimicbot.git
  2. Navigate into the cloned directory cd mimicbot
  3. Install the dependencies pip install -r requirements.txt. If you have CUDA installed use pip install -r requirements-gpu.txt instead. (WARNING: the dependencies will consume a lot of space. If you have an environment with pytorch already installed it is advisable that you use that environment.)
  4. Run the command python -m mimicbot_cli forge. This command will guide you through the creation of the bot from start to finish.
  5. Once the mimicbot is activated on discord, you can interact with it by simply sending it a message as you would to the person it is imitating, with a @<NAME_OF_MIMICBOT> mention somewhere in the text. The mimicbot will then reply with a message similar to how the original user would have said it.

Deploy

Although technically you could deploy your bot to any server using this repository it is not recommended primarily because of the heavy dependencies. Consequently, the mimicbot-deploy repository was built for ease of deployment. Follow the steps listed in its README to deploy your bot.

If you are still interested in deploying with this repository you can do so by either running forge on the server or passing the configuration files and data files to the appropriate paths on the server and then running activate.

Todo

(Feel free to contribute) - [x] Incorporate github actions to run the pytest tests. - [x] Enable bots to mention users in the channel. - [ ] More error handling. - [ ] Linux support. - [ ] Add linting. - [ ] github action. - [ ] Use DiscordChatExporter cli as the primary source of mining data to be able to capture dm data in addition to guild data. It also does not require admin access for guilds. The only catch is its security is yet to be determined. - [ ] Embed training settings into the CLI command - [ ] More flexible with inputs - [ ] Target user input - [ ] Guild channel names - [ ] Make sure the bot learns as it is being used. - [ ] Create a public server for running through the pipeline and adding deploying the bot. Will work by simply downloading the bot and commanding it to copy a user, then wait a couple minutes and BAM! It's mimicing. - [ ] Add testing - [ ] activate command unit tests - [ ] train command unit tests - [ ] End to end tests

Mini-guides

Quick guides to clear up the more confusing parts to getting up and running with mimicbot.

Setting up Discord bot (and retrieving API token)

If you are running mimicbot_cli forge on the CLI make sure to complete this guide before submitting the API key. 1. Create a discord developer account and log in. 2. Create a discord application in applications page of the developer portal. applications page 3. Add a bot to the application in the bot settings inside your application. add bot 4. Click on the reset token button which will then prompt you to copy the token, this is the token you will provide to mimicbot. Then activate the "server members intent" and the "message content intent". bot settings 5. Navigate to OAuth2 > URL Generator then check "bot" as the scope. Then check the "Read Messages/View Channels" general permission and "Send Messages" text permission. Finally, once all of those are checked copy the Generated URL. image 6. (You must be signed into your discord account on the browser) Simply navigate to the URL you copied, then select the server (you must have admin privileges) where you want to both: mine data and activate the bot. Click create. image 7. Click authorize, click through Captcha, and you're done! Your discord bot is be ready to go! image 8. If you are running mimicbot_cli forge make sure to return to the CLI, enter your Discord API token and continue on the CLI.

Retrieving Huggingface API token

If you are running mimicbot_cli forge on the CLI make sure to complete this guide before moving submitting the API key. 1. Create a huggingface account and log in. 2. Navigate to your settings. 3. Click on the "Access Tokens" tab, then create a "New Token". Then label it, select its "Role" as "write", and press "Generate a token". image 4. Copy the "write" token, this is the token you will provide to mimicbot. image 5. If you are running mimicbot_cli forge make sure to return to the CLI, enter your Huggingface API token and continue on the CLI.

Spining up Docker Environement

  1. Verify you have docker installed and running by using docker ps. You may install it from their official installation page.
  2. Create a new docker image by running docker build -t mimicbot ..
  3. Run the docker image with docker run -it --name <ANY_NAME> mimicbot /bin/bash.
  4. You are now ready to start using mimicbot's CLI.
  5. You may return to the same container by running docker start -ai <ANY_NAME>

Troubleshooting

Errors may occur here are common ones with solutions.

GPU error

  1. Visit this colab notebook.
  2. Copy all files in your /DATA_PATH/colab into the root directory of the notebook. (If you don't know what your DATA_PATH is, enter the following command in a terminal: python -m mimicbot_cli config. Then find the line that with the text data_path = ... your DATA_PATH is listed there.) image
  3. Click on the "Edit" tab and then click on the "Notebook settings". Select "GPU" for Hardware accelerator, and finally click "Save". image image
  4. Click on the "Runtime" tab, then click "Run all". image
  5. Wait for the script to finish. You will know it is done with the following indicators: 1. The favicon is yellow, 2. There is a green checkmark next to the cell, and 3. Scroll all the way down to the bottom of the output and you should see a timestamped message saying "Training finished". image

Owner

  • Name: Sebastian Sosa
  • Login: CakeCrusher
  • Kind: user
  • Company: None

Passionate about learning and building the extraordinary systems of the world

GitHub Events

Total
  • Watch event: 1
  • Issue comment event: 2
  • Push event: 1
Last Year
  • Watch event: 1
  • Issue comment event: 2
  • Push event: 1

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 91
  • Total Committers: 3
  • Avg Commits per committer: 30.333
  • Development Distribution Score (DDS): 0.11
Past Year
  • Commits: 2
  • Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
CakeCrusher 1****1@g****m 81
Sebastian Sosa 3****r 8
Michael Hoobler h****l@g****m 2

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 4
  • Total pull requests: 7
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 29 minutes
  • Total issue authors: 4
  • Total pull request authors: 4
  • Average comments per issue: 5.25
  • Average comments per pull request: 0.0
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 2.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • atagulalan (1)
  • ankan-stack (1)
  • mhoobler (1)
  • piee-kun (1)
Pull Request Authors
  • CakeCrusher (4)
  • victoryv21 (2)
  • Copilot (1)
  • mhoobler (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 13 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 4
  • Total maintainers: 1
pypi.org: mimicbot-cli

Tools and a pipeline for creating of an AI chat bot modeled to imitate a user

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 8 Last month
Rankings
Dependent packages count: 6.6%
Forks count: 15.7%
Stargazers count: 18.6%
Average: 23.3%
Dependent repos count: 30.6%
Downloads: 45.0%
Maintainers (1)
Last synced: 6 months ago
pypi.org: mimicbot-chat

Chat utils for mimicbot

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 5 Last month
Rankings
Dependent packages count: 10.1%
Forks count: 15.4%
Stargazers count: 18.5%
Dependent repos count: 21.5%
Average: 23.7%
Downloads: 53.1%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • aiohttp ==3.7.4.post0
  • argcomplete ==2.0.0
  • async-timeout ==3.0.1
  • atomicwrites ==1.4.0
  • attrs ==21.4.0
  • certifi ==2021.10.8
  • chardet ==4.0.0
  • charset-normalizer ==2.0.12
  • click ==8.1.2
  • colorama ==0.4.4
  • discord.py ==1.7.3
  • distlib ==0.3.4
  • filelock ==3.6.0
  • gunicorn ==20.1.0
  • idna ==3.3
  • iniconfig ==1.1.1
  • multidict ==6.0.2
  • numpy ==1.23.0
  • packaging ==21.3
  • pandas ==1.4.3
  • pipenv ==2022.3.28
  • pipx ==1.0.0
  • platformdirs ==2.5.1
  • pluggy ==1.0.0
  • praw ==7.5.0
  • prawcore ==2.3.0
  • py ==1.11.0
  • pyparsing ==3.0.7
  • pytest ==7.1.2
  • python-dateutil ==2.8.2
  • pytz ==2022.1
  • pywin32 ==304
  • requests ==2.27.1
  • six ==1.16.0
  • tomli ==2.0.1
  • traitlets ==5.2.2.post1
  • typer ==0.4.1
  • typing_extensions ==4.2.0
  • update-checker ==0.18.0
  • urllib3 ==1.26.8
  • userpath ==1.8.0
  • virtualenv ==20.14.0
  • virtualenv-clone ==0.5.7
  • wcwidth ==0.2.5
  • websocket-client ==1.3.1
  • yarl ==1.7.2
.github/workflows/pytest.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
Dockerfile docker
  • python 3.9 build
mimicbot_cli/setup.py pypi
  • pandas *
  • requests *
requirements-gpu.txt pypi
  • Jinja2 ==3.1.2
  • Markdown ==3.3.7
  • MarkupSafe ==2.1.1
  • Pillow ==9.2.0
  • PyYAML ==6.0
  • Pygments ==2.12.0
  • Send2Trash ==1.8.0
  • Werkzeug ==2.1.2
  • absl-py ==1.1.0
  • aiohttp ==3.7.4.post0
  • argcomplete ==2.0.0
  • argon2-cffi ==21.3.0
  • argon2-cffi-bindings ==21.2.0
  • asttokens ==2.0.5
  • async-timeout ==3.0.1
  • atomicwrites ==1.4.0
  • attrs ==21.4.0
  • backcall ==0.2.0
  • beautifulsoup4 ==4.11.1
  • bleach ==5.0.1
  • blessings ==1.7
  • cachetools ==5.2.0
  • certifi ==2021.10.8
  • cffi ==1.15.1
  • chardet ==4.0.0
  • charset-normalizer ==2.0.12
  • click ==8.1.2
  • colorama ==0.4.4
  • curtsies ==0.3.10
  • cwcwidth ==0.1.6
  • datasets ==2.3.2
  • debugpy ==1.6.2
  • decorator ==5.1.1
  • defusedxml ==0.7.1
  • dill ==0.3.5.1
  • discord.py ==1.7.3
  • distlib ==0.3.4
  • entrypoints ==0.4
  • executing ==0.8.3
  • fastjsonschema ==2.15.3
  • filelock ==3.6.0
  • fsspec ==2022.5.0
  • google-auth ==2.9.0
  • google-auth-oauthlib ==0.4.6
  • grpcio ==1.47.0
  • gunicorn ==20.1.0
  • huggingface-hub ==0.8.1
  • idna ==3.3
  • iniconfig ==1.1.1
  • ipykernel ==6.15.1
  • ipython ==8.4.0
  • ipython-genutils ==0.2.0
  • ipywidgets ==7.7.1
  • jedi ==0.18.1
  • joblib ==1.1.0
  • jsonschema ==4.6.2
  • jupyter-client ==7.3.4
  • jupyter-core ==4.11.1
  • jupyterlab-pygments ==0.2.2
  • jupyterlab-widgets ==1.1.1
  • matplotlib-inline ==0.1.3
  • mistune ==0.8.4
  • multidict ==6.0.2
  • multiprocess ==0.70.13
  • nbclient ==0.6.6
  • nbconvert ==6.5.0
  • nbformat ==5.4.0
  • nest-asyncio ==1.5.5
  • nltk ==3.7
  • notebook ==6.4.12
  • numpy ==1.23.0
  • oauthlib ==3.2.0
  • packaging ==21.3
  • pandas ==1.4.3
  • pandocfilters ==1.5.0
  • parso ==0.8.3
  • pickleshare ==0.7.5
  • pipenv ==2022.3.28
  • pipx ==1.0.0
  • platformdirs ==2.5.1
  • pluggy ==1.0.0
  • praw ==7.5.0
  • prawcore ==2.3.0
  • prometheus-client ==0.14.1
  • prompt-toolkit ==3.0.30
  • protobuf ==3.19.4
  • psutil ==5.9.1
  • pure-eval ==0.2.2
  • py ==1.11.0
  • pyarrow ==8.0.0
  • pyasn1 ==0.4.8
  • pyasn1-modules ==0.2.8
  • pycparser ==2.21
  • pyparsing ==3.0.7
  • pyrsistent ==0.18.1
  • pytest ==7.1.2
  • pytest-asyncio ==0.18.3
  • python-dateutil ==2.8.2
  • pytz ==2022.1
  • pywin32 ==304
  • pywinpty ==2.0.6
  • pyzmq ==23.2.0
  • regex ==2022.6.2
  • requests ==2.27.1
  • requests-oauthlib ==1.3.1
  • responses ==0.18.0
  • rouge-score ==0.0.4
  • rsa ==4.8
  • six ==1.16.0
  • soupsieve ==2.3.2.post1
  • stack-data ==0.3.0
  • tensorboard ==2.9.1
  • tensorboard-data-server ==0.6.1
  • tensorboard-plugin-wit ==1.8.1
  • tensorboardX ==2.5.1
  • terminado ==0.15.0
  • tinycss2 ==1.1.1
  • tokenizers ==0.12.1
  • tomli ==2.0.1
  • torch ==1.12.0
  • torchaudio ==0.12.0
  • torchvision ==0.13.0
  • tornado ==6.2
  • tqdm ==4.64.0
  • traitlets ==5.2.2.post1
  • transformers ==4.20.1
  • typer ==0.4.1
  • typing_extensions ==4.2.0
  • update-checker ==0.18.0
  • urllib3 ==1.26.8
  • userpath ==1.8.0
  • virtualenv ==20.14.0
  • virtualenv-clone ==0.5.7
  • wcwidth ==0.2.5
  • webencodings ==0.5.1
  • websocket-client ==1.3.1
  • widgetsnbextension ==3.6.1
  • xxhash ==3.0.0
  • yarl ==1.7.2
setup.py pypi
  • aiohttp ==3.7.4
  • configparser *
  • datasets *
  • discord.py ==1.7.3
  • huggingface-hub *
  • ipywidgets *
  • numpy *
  • pandas *
  • requests *
  • rouge-score *
  • tensorboard *
  • torch *
  • torchaudio *
  • torchvision *
  • tqdm *
  • transformers *
  • typer *