2023-01-13 16:21:56 +01:00
|
|
|
# Presentator
|
2023-01-13 17:32:02 +01:00
|
|
|
A Discord bot that generates FULL powerpoints about a given subject thanks to openai's gpt3.
|
2023-01-13 17:53:35 +01:00
|
|
|
|
|
|
|
|
<img src="https://raw.githubusercontent.com/Paillat-dev/presentator/main/examples/steve-jobs/Steve-Jobs-1.png" width="600" >
|
|
|
|
|
<img src="https://raw.githubusercontent.com/Paillat-dev/presentator/main/examples/python/the-python-programming-language-1.png" width="600" >
|
|
|
|
|
|
2023-01-13 17:32:02 +01:00
|
|
|
|
|
|
|
|
# How it works
|
|
|
|
|
- The bot sends a request to the openai api with the given subject and indications in the marp markdown format
|
|
|
|
|
- We extract the images from the markdown and send them to the image generation api
|
|
|
|
|
- We generate the pdf and html files from the markdown
|
|
|
|
|
- We send the pdf and html files to the user
|
2023-01-13 16:21:56 +01:00
|
|
|
|
2023-01-13 17:32:02 +01:00
|
|
|
# How to install
|
2023-01-20 13:30:45 +01:00
|
|
|
**IMPORTANT** Linux and MacOS installation isn't documented yet, if anyone wanths to complete it, feel free to do a pull request.
|
2023-01-13 16:21:56 +01:00
|
|
|
## Requirements
|
|
|
|
|
- Python 3.8
|
|
|
|
|
- Pip
|
|
|
|
|
- A Discord bot token
|
|
|
|
|
- An openai api key
|
2023-01-20 13:30:45 +01:00
|
|
|
- (Optional) An Nvidia GPU (for local image generation)
|
2023-01-13 16:21:56 +01:00
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
- Clone the repository
|
|
|
|
|
- Install the requirements with
|
|
|
|
|
`pip install -r requirements.txt`
|
2023-01-13 17:32:02 +01:00
|
|
|
- Install scoop (if not alredy installed) by typing the following commands:
|
|
|
|
|
```
|
|
|
|
|
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
|
|
|
irm get.scoop.sh | iex
|
|
|
|
|
```
|
|
|
|
|
- Install marp by doing
|
|
|
|
|
```
|
|
|
|
|
scoop install marp
|
|
|
|
|
```
|
|
|
|
|
- Restart your computer
|
2023-01-20 13:38:37 +01:00
|
|
|
- Put your openai api key and discord bot token in the `.env.example` file and rename it to `.env`
|
2023-01-13 16:21:56 +01:00
|
|
|
|
2023-01-20 13:30:45 +01:00
|
|
|
## Image generation (optional)
|
|
|
|
|
### With Stable Diffusion UI (powerful gpu option)
|
2023-01-13 16:21:56 +01:00
|
|
|
- Install [Stable Diffusion UI](https://github.com/cmdr2/stable-diffusion-ui) and switch to the `beta` branch.
|
|
|
|
|
- Copy the `./image_gen_api/main.py` file to the `stable-diffusion-ui` folder
|
|
|
|
|
- Open the file called `Dev Console.cmd` in the `stable-diffusion-ui` folder and run the following commands:
|
|
|
|
|
```
|
|
|
|
|
pip install uvicorn
|
|
|
|
|
pip install fastapi
|
|
|
|
|
```
|
2023-01-20 13:38:37 +01:00
|
|
|
- In the file `.env`, set the `USE_IMAGES` variable to `sd`
|
2023-01-20 13:30:45 +01:00
|
|
|
### With DALL·E 2 (costs dalle credits)
|
2023-01-20 13:38:37 +01:00
|
|
|
- In the file `.env`, set the `USE_IMAGES` variable to `dalle`
|
2023-01-13 17:32:02 +01:00
|
|
|
# Running
|
2023-01-13 16:21:56 +01:00
|
|
|
- Run the `main.py` file with :
|
|
|
|
|
```
|
|
|
|
|
python main.py
|
|
|
|
|
```
|
|
|
|
|
|
2023-01-20 13:30:45 +01:00
|
|
|
### Local image generation (optional, only if you use the local image generation option)
|
2023-01-13 16:21:56 +01:00
|
|
|
- Open the file called `Dev Console.cmd` in the `stable-diffusion-ui` folder and run the following commands:
|
|
|
|
|
```
|
|
|
|
|
uvicorn main:app --reload
|
|
|
|
|
```
|
|
|
|
|
|
2023-01-13 17:32:02 +01:00
|
|
|
# Commands
|
2023-01-13 16:21:56 +01:00
|
|
|
- `/present` : Generates a pdf presentation about the given subject
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
- `subject` : The subject of the presentation
|
|
|
|
|
- `language` : The language of the presentation (default: `english`)
|
|
|
|
|
- `style` : The style of the presentation (default: `default`)
|
|
|
|
|
- `indications` : Some more instructions about how the presentation should be generated (default: `None`)
|
|
|
|
|
- `/list` : Lists all of your presentations
|
|
|
|
|
- `/get` : Gets a presentation by its id another time
|
2023-01-13 18:01:17 +01:00
|
|
|
|
|
|
|
|
# Help
|
|
|
|
|
You can join our discord server if you need help
|
2023-01-13 18:05:41 +01:00
|
|
|
https://discord.gg/pB6hXtUeDv
|
2023-01-13 18:01:17 +01:00
|
|
|
|
2023-01-13 18:05:41 +01:00
|
|
|
Have fun!
|