Giter Club home page Giter Club logo

moondream_discord_bot's Introduction

Moonsdream Discord Bot

The Moonsdream Discord Bot is an AI-powered bot that allows users to upload an image and ask questions about it. The bot answers with text responses based on the Moondream model. Users can ask multiple questions, and the bot will answer each one based on the context of the uploaded image.

Installation

Follow these steps to install and set up the Moonsdream Discord Bot:

Cloning the Moondream Repository

  1. In the main directory, clone the Moondream repository and switch to the required commit:

    git clone https://github.com/vikhyat/moondream.git
     cd moondream
     git checkout 3f4815bd86aabb18724d74ef024adeff6c53914e

Installing Dependencies

  1. Install Main Dependencies: Install the requirements from the main directory:

    pip install -r requirements.txt
  2. Install Moondream Dependencies: Navigate to the Moondream directory and install its specific requirements:

    cd moondream
    pip install -r requirements.txt

Setting Up for GPU Usage (Optional)

  1. GPU Mode Setup:
    • If you plan to run Moondream in GPU mode, uninstall the existing torch installation:

      pip uninstall torch
    • Visit PyTorch's official site and run the latest PyTorch + CUDA command based on your system's configuration.

    • For example:

      pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

Starting the Bot

To start the Moonsdream Discord Bot:

  1. Discord Token: Provide a valid Discord token in the .env file under DISCORD_BOT_TOKEN.

  2. Database Logging (Optional):

    • If you want to log user interactions to a database, first run the create_db.py script.
    • Set collect_interactions_in_db in bot.py to True.
  3. Run the Bot: Start the bot by running the bot.py file:

    python bot.py

Bot Functionality

  • Users upload an image and can ask questions about it. The bot responds based on the Moondream model's analysis of the image.
  • If a question is not asked during the image upload, the bot will ask a default question: "What's in the image?"
  • Users can upload a new image at any time, and subsequent questions will be answered based on the new image.
  • The bot supports handling user context based on Discord's user_id. If the bot is restarted, the context is maintained.

moondream_discord_bot's People

Watchers

Kostas Georgiou avatar Maciek Popławski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.